From: Kevin McCarthy Date: Tue, 31 Jan 2017 22:27:09 +0000 (-0800) Subject: Fix the mutt_label_complete() pos parameter. X-Git-Tag: neomutt-20170225~32^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2db2dbb847ff4aff8636eb86f16c620b5b25f471;p=neomutt 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 9dd134e45..d8fc2a513 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) {