]> granicus.if.org Git - mutt/commitdiff
Yet another fix to the alias and query completion stuff:
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Sep 1998 14:54:47 +0000 (14:54 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Sep 1998 14:54:47 +0000 (14:54 +0000)
Skip leading white space when constructing the addresses.

enter.c

diff --git a/enter.c b/enter.c
index d528713ef45ac7704de1542fae2f1ddbcdc33979..7ff8fb95a7635e155b9457d04b49c152c9f04966 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -330,7 +330,9 @@ int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x,
            if (curpos)
            {
              for (j = curpos - 1 ; j >= 0 && buf[j] != ',' ; j--);
-             if (mutt_alias_complete ((char *) buf + j + 1, buflen - j - 1))
+             for (++j; buf[j] == ' '; j++)
+               ;
+             if (mutt_alias_complete ((char *) buf + j, buflen - j))
              {
                redraw = M_REDRAW_INIT;
                continue;
@@ -385,7 +387,8 @@ int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x,
            if (curpos)
            {
              for (j = curpos - 1 ; j >= 0 && buf[j] != ',' ; j--);
-             mutt_query_complete ((char *) buf + j + 1, buflen - j - 1);
+             for (j++; buf[j] == ' '; j++);
+             mutt_query_complete ((char *) buf + j, buflen - j);
            }
            else
              mutt_query_menu ((char *) buf, buflen);