aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/parse.c')
-rw-r--r--bootstrap/parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c
index 3e14dc3..706bfb5 100644
--- a/bootstrap/parse.c
+++ b/bootstrap/parse.c
@@ -136,9 +136,12 @@ aishsep(char c) {
static int
readtilhsep(struct parser *P, char *buf, int n, bool dot) {
int i = 0;
+ bool (*pred)(char) = aishsep;
u8 c;
- while (!aishsep((c = chrpeek(P))) || (dot && c == '.')) {
+ while (!pred((c = chrpeek(P))) || (dot && c == '.')) {
chr(P);
+ if (!aissep(c))
+ pred = aissep;
if (i >= n - 1)
return -1;
buf[i++] = c;