]> 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)
committerKevin McCarthy <kevin@8t8.us>
Tue, 31 Jan 2017 22:27:09 +0000 (14:27 -0800)
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 9dd134e45169a5381350ebff0c8b1e7a56fde2d3..d8fc2a51312602322428890be82e9535275f3965 100644 (file)
--- 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)
            {