From: Kevin McCarthy Date: Tue, 31 Jan 2017 22:27:09 +0000 (-0800) Subject: Fix the mutt_label_complete() pos parameter. X-Git-Tag: mutt-1-8-rel~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d0b7c2228a3d610a61c85fddeb409a5b07d01fb;p=mutt Fix the mutt_label_complete() pos parameter. i is the state->wbuf index, not the end of the buf. It was "working" only because the contents of buf past the null were not "space" most of the time. --- diff --git a/enter.c b/enter.c index 9dd134e4..d8fc2a51 100644 --- a/enter.c +++ b/enter.c @@ -575,7 +575,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, for (; i < state->lastchar && state->wbuf[i] == ' '; i++) ; my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i); - r = mutt_label_complete (buf, buflen, i, state->tabs); + r = mutt_label_complete (buf, buflen, strlen (buf), state->tabs); replace_part (state, i, buf); if (!r) {