commit 1524086ce6c6f48fb2c003ee4b2c34a30b735354
parent 17e3bc800a4016186c88bb5c12da29fdff473ef6
Author: Louis Burda <quent.burda@gmail.com>
Date: Sat, 22 May 2021 14:43:09 +0200
fix for 17e3bc8 breaking ascii kwarg parsing
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/service/src/stlfile.c b/service/src/stlfile.c
@@ -76,14 +76,14 @@ skipws(char *p)
char*
consume_arg(char **start, char **end)
{
- char *p, *tmp;
+ char *c, *tmp;
- p = skipws(*start);
- for (; !isws(*p); p++);
- if (!*p) return NULL;
+ *start = skipws(*start);
+ if (!*start) return NULL;
+ for (c = *start; *c && !isws(*c); c++);
tmp = *start;
- *start = p + 1;
- *end = p;
+ *start = c + 1;
+ *end = c;
return tmp;
}
@@ -97,7 +97,7 @@ consume_keyword(char **start)
for (i = 0; i < ARRSIZE(kwmap); i++) {
len = strlen(kwmap[i].str);
- if (!strncmp(kwmap[i].str, bp, len) && isws(*(bp + len))) {
+ if (!strncmp(kwmap[i].str, bp, len) && (!bp[len] || isws(bp[len]))) {
// printf("GOT: %s\n", kwmap[i].str);
*start = bp + len + (bp[len] ? 1 : 0);
return kwmap[i].code;