]> granicus.if.org Git - neomutt/commitdiff
Fix the mutt_label_complete() pos parameter.
authorKevin McCarthy <kevin@8t8.us>
Tue, 31 Jan 2017 22:27:09 +0000 (14:27 -0800)
committerRichard Russon <rich@flatcap.org>
Fri, 10 Feb 2017 03:32:55 +0000 (03:32 +0000)
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.

enter.c

diff --git a/enter.c b/enter.c
index 1917c75d653f137d6dbfff10a483f4462be75bfe..1132c94bb8ae3a1056c9d8ea94e748128009b47e 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -574,7 +574,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)
            {