From 1d1027625078f6a8c6cd932645e6057230ffb201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 2 Nov 2016 22:58:03 +0100 Subject: 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. --- sam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sam.c') diff --git a/sam.c b/sam.c index 315dc11..237396f 100644 --- 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)) -- cgit v1.2.3