aboutsummaryrefslogtreecommitdiffstats
path: root/service/src/stlfile.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-05-22 14:43:09 +0200
committerLouis Burda <quent.burda@gmail.com>2021-05-22 14:43:09 +0200
commit1524086ce6c6f48fb2c003ee4b2c34a30b735354 (patch)
tree1b3f43454a40f5d43d155dc0054da2f9162dbf5d /service/src/stlfile.c
parent17e3bc800a4016186c88bb5c12da29fdff473ef6 (diff)
downloadenowars5-service-stldoctor-1524086ce6c6f48fb2c003ee4b2c34a30b735354.tar.gz
enowars5-service-stldoctor-1524086ce6c6f48fb2c003ee4b2c34a30b735354.zip
fix for 17e3bc8 breaking ascii kwarg parsing
Diffstat (limited to 'service/src/stlfile.c')
-rw-r--r--service/src/stlfile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/service/src/stlfile.c b/service/src/stlfile.c
index 58bb5af..4dda8ee 100644
--- 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;