Commit 13d6c4cc authored by Michael Elkins's avatar Michael Elkins

"complete" function should consider shell chars to be word boundaries when...

"complete" function should consider shell chars to be word boundaries when doing filename completion (bug #2871)
parent 30efefb6
......@@ -186,6 +186,15 @@ static void replace_part (ENTER_STATE *state, size_t from, char *buf)
FREE (&savebuf);
}
/*
* Return 1 if the character is not typically part of a pathname
*/
inline int is_shell_char(wchar_t ch)
{
static wchar_t shell_chars[] = L"<>&()$?*;{} "; /* ! not included because it can be part of a pathname in Mutt */
return wcschr(shell_chars, ch) != NULL;
}
/*
* Returns:
* 1 need to redraw the screen and call me again
......@@ -477,7 +486,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
state->tabs++;
if (flags & M_CMD)
{
for (i = state->curpos; i && state->wbuf[i-1] != ' '; i--)
for (i = state->curpos; i && !is_shell_char(state->wbuf[i-1]); i--)
;
my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);
if (tempbuf && templen == state->lastchar - i &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment