]> git.wh0rd.org Git - nano.git/commitdiff
- files.c:do_browser() - Fix incorrect path check for check_operating_dir() (David...
authorChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 22:05:07 +0000 (22:05 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 26 Jan 2003 22:05:07 +0000 (22:05 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1401 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
files.c

index 999209d2f6d77d3b34e1dbf274a8ac2b00cfdac0..5b8876c557527fa75bbf32e5a5218d52591a18e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@ CVS Code -
        - Fix incorrect cursor location when cutting long lines
          (David Benbennick).
 - files.c:
+  do_browser()
+       - Fix incorrect path check for check_operating_dir() 
+         (David Benbennick).
   open_file()
        - Fix FD leak with file load error (David Benbennick).
   save_history()
diff --git a/files.c b/files.c
index e6225a4113a39a805fe6ca4cc1cc9f2f83ab9d14..b967d2584281f9efeff939c276c0b519074a384f 100644 (file)
--- a/files.c
+++ b/files.c
@@ -2613,14 +2613,12 @@ char *do_browser(const char *inpath)
                break;
            }
 
-           path = mallocstrcpy(path, filelist[selected]);
-
 #ifndef DISABLE_OPERATINGDIR
            /* Note: The case of the user's being completely outside the
               operating directory is handled elsewhere, before this
               point */
            if (operating_dir != NULL) {
-               if (check_operating_dir(path, 0)) {
+               if (check_operating_dir(filelist[selected], 0)) {
                    statusbar(_("Can't visit parent in restricted mode"));
                    beep();
                    break;
@@ -2628,6 +2626,8 @@ char *do_browser(const char *inpath)
            }
 #endif
 
+           path = mallocstrcpy(path, filelist[selected]);
+
            /* SPK for '.' path, get the current path via getcwd */
            if (!strcmp(path, "./..")) {
                free(path);