From: Kevin McCarthy Date: Tue, 31 Jan 2017 23:02:21 +0000 (-0800) Subject: Minor fix to ~y completion. X-Git-Tag: mutt-1-8-rel~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5815844f032ec0e69d2b5a519e9ab620ff28535;p=mutt Minor fix to ~y completion. Make sure the entire ~y is before curpos when enabling completion. --- diff --git a/enter.c b/enter.c index 108311ef..dbbd786f 100644 --- a/enter.c +++ b/enter.c @@ -587,7 +587,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, { for (i = state->curpos; i && state->wbuf[i-1] != '~'; i--) ; - if (i && state->wbuf[i-1] == '~' && state->wbuf[i] == 'y') + if (i && i < state->curpos && state->wbuf[i-1] == '~' && state->wbuf[i] == 'y') { i++; my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);