summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-19 10:59:29 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-19 10:59:29 -0700
commitee0f10607a276ce239ba9ee61420809b766c5715 (patch)
tree27da7b0cbf1100ff8227f2fd1a3bfc54a1acf9ee /regex.c
parente68b978b40c53b7fef21056c2d1c1dff0b6bb729 (diff)
downloadtxr-ee0f10607a276ce239ba9ee61420809b766c5715.tar.gz
txr-ee0f10607a276ce239ba9ee61420809b766c5715.tar.bz2
txr-ee0f10607a276ce239ba9ee61420809b766c5715.zip
Bugfix: throwing error when trying to print valid regexps.
* regex.c (print_rec): Only dianose "bad object in regex syntax" for some atom other than nil, which denotes an empty (sub)expression, like what results from #// or #/a|/ and such.
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 fade9449..b8e7daec 100644
--- a/regex.c
+++ b/regex.c
@@ -1831,7 +1831,7 @@ static void print_rec(val exp, val stream)
} else {
uw_throwf(error_s, lit("bad operator in regex syntax: ~s"), sym, nao);
}
- } else {
+ } else if (exp != nil) {
uw_throwf(error_s, lit("bad object in regex syntax: ~s"), exp, nao);
}
}