Changeset 5094:097deb080af0
- Timestamp:
- 2007-04-07 15:08:44 (20 months ago)
- Author:
- Michael Elkins <me@…>
- Branch:
- HEAD
- Message:
-
"complete" function should consider shell chars to be word boundaries when doing filename completion (bug #2871)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5053
|
r5094
|
|
| 188 | 188 | |
| 189 | 189 | /* |
| | 190 | * Return 1 if the character is not typically part of a pathname |
| | 191 | */ |
| | 192 | inline int is_shell_char(wchar_t ch) |
| | 193 | { |
| | 194 | static wchar_t shell_chars[] = L"<>&()$?*;{} "; /* ! not included because it can be part of a pathname in Mutt */ |
| | 195 | return wcschr(shell_chars, ch) != NULL; |
| | 196 | } |
| | 197 | |
| | 198 | /* |
| 190 | 199 | * Returns: |
| 191 | 200 | * 1 need to redraw the screen and call me again |
| … |
… |
|
| 478 | 487 | if (flags & M_CMD) |
| 479 | 488 | { |
| 480 | | for (i = state->curpos; i && state->wbuf[i-1] != ' '; i--) |
| | 489 | for (i = state->curpos; i && !is_shell_char(state->wbuf[i-1]); i--) |
| 481 | 490 | ; |
| 482 | 491 | my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i); |