]> granicus.if.org Git - mutt/commitdiff
Fix Debian#237426. (Experimental.)
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Wed, 14 Jul 2004 05:45:18 +0000 (05:45 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Wed, 14 Jul 2004 05:45:18 +0000 (05:45 +0000)
browser.c

index f60295b95acb5e4a35eda1dafb8f0b1b00bd16fc..4dc4cc716928b24ed69cd08b807037a62f5449fc 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -944,21 +944,21 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
          {
            if (S_ISDIR (st.st_mode))
            {
-             strfcpy (LastDir, buf, sizeof (LastDir));
              destroy_state (&state);
-             if (examine_directory (menu, &state, LastDir, prefix) == 0)
-             {
-               menu->current = 0; 
-               menu->top = 0; 
-               init_menu (&state, menu, title, sizeof (title), buffy);
-             }
+             if (examine_directory (menu, &state, buf, prefix) == 0)
+               strfcpy (LastDir, buf, sizeof (LastDir));
              else
              {
                mutt_error _("Error scanning directory.");
-               destroy_state (&state);
-               mutt_menuDestroy (&menu);
-               goto bail;
+               if (examine_directory (menu, &state, LastDir, prefix) == -1)
+               {
+                 mutt_menuDestroy (&menu);
+                 goto bail;
+               }
              }
+             menu->current = 0; 
+             menu->top = 0; 
+             init_menu (&state, menu, title, sizeof (title), buffy);
            }
            else
              mutt_error (_("%s is not a directory."), buf);