summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index faf38965..4ad34dcf 100644
--- a/regex.c
+++ b/regex.c
@@ -2579,7 +2579,7 @@ val read_until_match(val regex, val stream_in, val include_match_in)
if (nil) {
out_match:
- while (stack != match)
+ while (stack && stack != match)
unget_char(rcyc_pop(&stack), stream);
if (!out)
out = null_string;