]> git.wh0rd.org Git - nano.git/commitdiff
simplify
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 30 Jun 2006 14:28:32 +0000 (14:28 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 30 Jun 2006 14:28:32 +0000 (14:28 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3707 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/browser.c

index 2f1350f073cdd3bfa9111b60e1e745bf4a456272..2d53601e6bc4d3beb7036e9c9a8e2ccdc9df44ec 100644 (file)
@@ -330,12 +330,9 @@ char *do_browser(char *path, DIR *dir)
                /* If we've successfully opened a directory, and it's
                 * "..", save the current directory in prev_dir, so that
                 * we can select it later. */
-               } else if (strcmp(tail(filelist[selected]),
-                       "..") == 0) {
-                   prev_dir = mallocstrcpy(NULL, filelist[selected]);
-                   prev_dir = mallocstrassn(prev_dir,
-                       striponedir(prev_dir));
-               }
+               } else if (strcmp(tail(filelist[selected]), "..") == 0)
+                   prev_dir = mallocstrcpy(NULL,
+                       striponedir(filelist[selected]));
 
                dir = opendir(filelist[selected]);
                if (dir == NULL) {