Attempt bracketing checking.

Too bad we can't issue a diagnostic here now; we just return failure
and the caller will probably next try a whitespace delimited string
next.
This commit is contained in:
Olaf Seibert
2021-02-18 22:49:52 +01:00
parent 289860e539
commit 54b73f7f9c
3 changed files with 73 additions and 19 deletions

14
parse.c
View File

@@ -831,12 +831,18 @@ int brackrange(
return FALSE;
}
/*
* If we see a newline here, the proper terminator must be missing.
* Don't use EOL() to check: it recognizes ';' too.
* Unfortunately we can't issue a diagnostic here.
*/
if (!cp[len] || cp[len] == '\n') {
return FALSE;
}
*length = len;
if (endp) {
*endp = cp + len;
if (**endp && **endp != '\n') {
++*endp; /* skip over ending delimiter */
}
*endp = cp + len + 1; /* skip over ending delimiter */
}
return 1;