summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-15 22:59:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-15 22:59:38 -0700
commit3df89b1573d415bb18a912c4c774edc189b1ac11 (patch)
treea1ecc6d98e9aa5a420132e6cd2e546e29a1dd0e8 /regex.c
parent506cb6b8dfd3ad55bc0bef4701bbea396e9b05ac (diff)
downloadtxr-3df89b1573d415bb18a912c4c774edc189b1ac11.tar.gz
txr-3df89b1573d415bb18a912c4c774edc189b1ac11.tar.bz2
txr-3df89b1573d415bb18a912c4c774edc189b1ac11.zip
Some streamlining in the cons recycling.
* lib.c (rcyc_pop): Just assume that *plist points to a cons and access the fields directly. (rcyc_cons): Don't bother with rplacd. (rcyc_list): Don't bother with set macro. * regex.c (read_until_match): Defensive coding: locally ensure that rcyc_pop won't be called on a nil stack, which will now segfault.
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;