| 996 | | destroy_state (&state); |
| 997 | | if (examine_directory (menu, &state, buf, prefix) == 0) |
| 998 | | strfcpy (LastDir, buf, sizeof (LastDir)); |
| | 995 | /* in case dir is relative, make it relative to LastDir, |
| | 996 | * not current working dir */ |
| | 997 | char tmp[_POSIX_PATH_MAX]; |
| | 998 | mutt_concat_path (tmp, LastDir, buf, sizeof (tmp)); |
| | 999 | strfcpy (buf, tmp, sizeof (buf)); |
| | 1000 | } |
| | 1001 | if (stat (buf, &st) == 0) |
| | 1002 | { |
| | 1003 | if (S_ISDIR (st.st_mode)) |
| | 1004 | { |
| | 1005 | destroy_state (&state); |
| | 1006 | if (examine_directory (menu, &state, buf, prefix) == 0) |
| | 1007 | strfcpy (LastDir, buf, sizeof (LastDir)); |
| | 1008 | else |
| | 1009 | { |
| | 1010 | mutt_error _("Error scanning directory."); |
| | 1011 | if (examine_directory (menu, &state, LastDir, prefix) == -1) |
| | 1012 | { |
| | 1013 | mutt_menuDestroy (&menu); |
| | 1014 | goto bail; |
| | 1015 | } |
| | 1016 | } |
| | 1017 | menu->current = 0; |
| | 1018 | menu->top = 0; |
| | 1019 | init_menu (&state, menu, title, sizeof (title), buffy); |
| | 1020 | } |
| 1000 | | { |
| 1001 | | mutt_error _("Error scanning directory."); |
| 1002 | | if (examine_directory (menu, &state, LastDir, prefix) == -1) |
| 1003 | | { |
| 1004 | | mutt_menuDestroy (&menu); |
| 1005 | | goto bail; |
| 1006 | | } |
| 1007 | | } |
| 1008 | | menu->current = 0; |
| 1009 | | menu->top = 0; |
| 1010 | | init_menu (&state, menu, title, sizeof (title), buffy); |
| | 1022 | mutt_error (_("%s is not a directory."), buf); |