Changeset 5094:097deb080af0 for enter.c

Show
Ignore:
Timestamp:
2007-04-07 15:08:44 (21 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:
1 modified

Legend:

Unmodified
Added
Removed
  • enter.c

    r5053 r5094  
    188188 
    189189/* 
     190 * Return 1 if the character is not typically part of a pathname 
     191 */ 
     192inline 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/* 
    190199 * Returns: 
    191200 *      1 need to redraw the screen and call me again 
     
    478487          if (flags & M_CMD) 
    479488          { 
    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--) 
    481490              ; 
    482491            my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);