Changeset 5209:964658b145df
- Timestamp:
- 2007-09-05 00:16:36 (16 months ago)
- Author:
- Rocco Rutte <pdmef@…>
- Branch:
- HEAD
- Message:
-
Interpret relative paths in browser relative to shown dir, not working
dir (closes #2471).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5138
|
r5209
|
|
| 990 | 990 | else |
| 991 | 991 | #endif |
| 992 | | if (stat (buf, &st) == 0) |
| 993 | | { |
| 994 | | if (S_ISDIR (st.st_mode)) |
| | 992 | { |
| | 993 | if (*buf != '/') |
| 995 | 994 | { |
| 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 | } |
| 999 | 1021 | else |
| 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); |
| 1011 | 1023 | } |
| 1012 | 1024 | else |
| 1013 | | mutt_error (_("%s is not a directory."), buf); |
| 1014 | | } |
| 1015 | | else |
| 1016 | | mutt_perror (buf); |
| | 1025 | mutt_perror (buf); |
| | 1026 | } |
| 1017 | 1027 | } |
| 1018 | 1028 | MAYBE_REDRAW (menu->redraw); |