changeset 26970:2eea71274bd1

Removed unused freepath variable. Patch by Guillaume Lecerf <foxcore at gmail com>
author ben
date Fri, 06 Jun 2008 23:24:39 +0000
parents 861ce0bb2773
children 2b0f08e696ba
files libmenu/menu_filesel.c
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmenu/menu_filesel.c	Fri Jun 06 20:26:19 2008 +0000
+++ b/libmenu/menu_filesel.c	Fri Jun 06 23:24:39 2008 +0000
@@ -391,7 +391,7 @@
 }
 
 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
@@ -411,10 +411,8 @@
         if (!fstat (path_fp, &st) && (st.st_size > 0)) {
           path = malloc(st.st_size+1);
           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))
-            freepath = path;
-          else {
+          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 +465,6 @@
   }
   r = open_dir(menu,path);
 
-  if (freepath)
-    free(freepath);
-  
   return r;
 }