Changeset 2224:8d5f6aa1cda8 for browser.c
Legend:
- Unmodified
- Added
- Removed
-
browser.c
r2150 r2224 52 52 53 53 static char LastDir[_POSIX_PATH_MAX] = ""; 54 static char LastDirBackup[_POSIX_PATH_MAX] = ""; 54 55 55 56 /* Frees up the memory allocated for the local-global variables. */ … … 519 520 } 520 521 521 void _mutt_select_file (char *f, size_t flen, int buffy, 522 int multiple, char ***files, int *numfiles) 522 void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *numfiles) 523 523 { 524 524 char buf[_POSIX_PATH_MAX]; … … 530 530 struct stat st; 531 531 int i, killPrefix = 0; 532 532 int multiple = (flags & M_SEL_MULTI) ? 1 : 0; 533 int folder = (flags & M_SEL_FOLDER) ? 1 : 0; 534 int buffy = (flags & M_SEL_BUFFY) ? 1 : 0; 535 536 buffy = buffy && folder; 537 533 538 memset (&state, 0, sizeof (struct browser_state)); 539 540 if (!folder) 541 strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup)); 534 542 535 543 if (*f) … … 582 590 else 583 591 { 584 if (!LastDir[0]) 592 if (!folder) 593 getcwd (LastDir, sizeof (LastDir)); 594 else if (!LastDir[0]) 585 595 strfcpy (LastDir, NONULL(Maildir), sizeof (LastDir)); 596 586 597 #ifdef USE_IMAP 587 598 if (!buffy && mx_is_imap (LastDir)) … … 599 610 { 600 611 if (examine_mailboxes (NULL, &state) == -1) 601 return;612 goto bail; 602 613 } 603 614 else … … 606 617 #endif 607 618 if (examine_directory (NULL, &state, LastDir, prefix) == -1) 608 return;619 goto bail; 609 620 610 621 menu = mutt_new_menu (); … … 743 754 { 744 755 strfcpy (LastDir, NONULL(Homedir), sizeof (LastDir)); 745 return;756 goto bail; 746 757 } 747 758 } … … 803 814 destroy_state (&state); 804 815 mutt_menuDestroy (&menu); 805 return;816 goto bail; 806 817 807 818 case OP_BROWSER_TELL: … … 937 948 destroy_state (&state); 938 949 mutt_menuDestroy (&menu); 939 return;950 goto bail; 940 951 } 941 952 } … … 1003 1014 mutt_error _("Error scanning directory."); 1004 1015 mutt_menuDestroy (&menu); 1005 return;1016 goto bail; 1006 1017 } 1007 1018 killPrefix = 0; … … 1069 1080 { 1070 1081 if (examine_mailboxes (menu, &state) == -1) 1071 return;1082 goto bail; 1072 1083 } 1073 1084 #ifdef USE_IMAP … … 1081 1092 #endif 1082 1093 else if (examine_directory (menu, &state, LastDir, prefix) == -1) 1083 return;1094 goto bail; 1084 1095 init_menu (&state, menu, title, sizeof (title), buffy); 1085 1096 break; … … 1093 1104 destroy_state (&state); 1094 1105 mutt_menuDestroy (&menu); 1095 return;1106 goto bail; 1096 1107 } 1097 1108 MAYBE_REDRAW (menu->redraw); … … 1111 1122 destroy_state (&state); 1112 1123 mutt_menuDestroy (&menu); 1113 return;1124 goto bail; 1114 1125 } 1115 1126 else … … 1141 1152 } 1142 1153 } 1143 /* not reached */ 1144 } 1154 1155 bail: 1156 1157 if (!folder) 1158 strfcpy (LastDir, LastDirBackup, sizeof (LastDir)); 1159 1160 }
