summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-07 19:57:57 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-07 19:57:57 +0300
commitaf3fcdf2ded43e887bceed3a957b5cc4f7dbc2c6 (patch)
tree2ead158ae6e6abfffcccf1609aa5492f9402e24f /libmenu
parentd5c868325cefcd5fad53361d1dfdc9757674eb70 (diff)
parent4653f5ed7575d6070b54a88b4deb449f838825b3 (diff)
downloadmpv-af3fcdf2ded43e887bceed3a957b5cc4f7dbc2c6.tar.bz2
mpv-af3fcdf2ded43e887bceed3a957b5cc4f7dbc2c6.tar.xz
Merge svn changes up to r27025
Conflicts: command.c libvo/vosub_vidix.c libvo/vosub_vidix.h mplayer.c
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu_filesel.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index d656c11c70..b0643deaf5 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -390,7 +390,7 @@ static void clos(menu_t* menu) {
}
static int open_fs(menu_t* menu, char* args) {
- char *path = mpriv->path, *freepath = NULL;
+ char *path = mpriv->path;
int r = 0;
char wd[PATH_MAX+1], b[PATH_MAX+1];
args = NULL; // Warning kill
@@ -409,12 +409,9 @@ 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] == '/'
- && !stat(path, &st) && S_ISDIR(st.st_mode)){
- freepath = path;
- path[st.st_size] = '\0';
- }
- else {
+ path[st.st_size] = '\0';
+ if (!((read(path_fp, path, st.st_size) == st.st_size) && path[0] == '/'
+ && !stat(path, &st) && S_ISDIR(st.st_mode))) {
free(path);
path = NULL;
}
@@ -467,9 +464,6 @@ static int open_fs(menu_t* menu, char* args) {
}
r = open_dir(menu,path);
- if (freepath)
- free(freepath);
-
return r;
}