From 8942eea65595fb5ecee17af71c466b44d1bce741 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 27 Sep 2015 19:17:14 -0700 Subject: 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. --- regex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3