summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-27 19:17:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-27 19:17:14 -0700
commit8942eea65595fb5ecee17af71c466b44d1bce741 (patch)
tree60c449b5cfd7ad16761b8a3db59282d4dd27dbee /regex.c
parent8b00d2d1919c204ff653863ff0485f483d418ff4 (diff)
downloadtxr-8942eea65595fb5ecee17af71c466b44d1bce741.tar.gz
txr-8942eea65595fb5ecee17af71c466b44d1bce741.tar.bz2
txr-8942eea65595fb5ecee17af71c466b44d1bce741.zip
Bug in complement case of reg_matches_all.
* regex.c (reg_matches_all): A complement matches all if its argument matches nothing, not if its argument is anything but the empty match nil.
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index cb490d40..8a9bc6ef 100644
--- a/regex.c
+++ b/regex.c
@@ -1479,7 +1479,8 @@ static val reg_matches_all(val exp)
} else if (sym == optional_s) {
return reg_matches_all(car(args));
} else if (sym == compl_s) {
- return tnil(car(args));
+ val arg = car(args);
+ return if2(arg == t, t);
} else if (sym == or_s) {
return tnil(reg_matches_all(pop(&args)) || reg_matches_all(pop(&args)));
} else if (sym == and_s) {