summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
authorulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-09 07:50:37 +0000
committerulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-09 07:50:37 +0000
commitaf4390363511dfb77bc0d9c802e8798d42a814c4 (patch)
tree6704c26c0bab46d2344eeb8c5b7543da209d70db /libmenu
parent6e9b19642ac094dd9f927d2e95b2e6a4b039366a (diff)
downloadmpv-af4390363511dfb77bc0d9c802e8798d42a814c4.tar.bz2
mpv-af4390363511dfb77bc0d9c802e8798d42a814c4.tar.xz
Use recorded last path only when stat it ok.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25327 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu_filesel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 3f91080f46..e81b49ef7f 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -413,7 +413,8 @@ static int open_fs(menu_t* menu, char* args) {
if (path_fp >= 0) {
if (!fstat (path_fp, &st) && (st.st_size > 0)) {
path = malloc(st.st_size+1);
- if ((read(path_fp, path, st.st_size) == st.st_size) && path[0] != '\0'){
+ if ((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/'
+ && !stat(path, &st) && S_ISDIR(st.st_mode)){
freepath = path;
path[st.st_size] = '\0';
}