]> granicus.if.org Git - mutt/commitdiff
Minor fix to ~y completion.
authorKevin McCarthy <kevin@8t8.us>
Tue, 31 Jan 2017 23:02:21 +0000 (15:02 -0800)
committerKevin McCarthy <kevin@8t8.us>
Tue, 31 Jan 2017 23:02:21 +0000 (15:02 -0800)
Make sure the entire ~y is before curpos when enabling completion.

enter.c

diff --git a/enter.c b/enter.c
index 108311ef096fb3936ad801c2a35a969989325c8b..dbbd786fb32d9ca507e890acd572c3cc78306fcb 100644 (file)
--- 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);