vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 01e8c0c999baf7d0d810c72fbf4940f4f8370e3a
parent c2d27d831e416aee02c414b590a1b0a408822760
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Wed,  2 Nov 2016 22:58:03 +0100

sam: fix command name parsing

Any white space should terminate the command name.
In particular multi-line commands as part of a group
were not handled correctly.

Diffstat:
Msam.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sam.c b/sam.c @@ -359,11 +359,11 @@ static void parse_argv(const char **s, const char *argv[], size_t maxarg) { } static char *parse_cmdname(const char **s) { - skip_spaces(s); Buffer buf; buffer_init(&buf); - while (**s && **s != ' ' && (!ispunct((unsigned char)**s) || **s == '-')) + skip_spaces(s); + while (**s && !isspace((unsigned char)**s) && (!ispunct((unsigned char)**s) || **s == '-')) buffer_append(&buf, (*s)++, 1); if (buffer_length(&buf))