summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-25 10:10:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-25 10:10:05 -0700
commit2707a8937c4b3f969e57f8ab599269feb693e903 (patch)
treeede57fa80dcd3dc5b9f56ef6cff33723e81ebb49 /regex.c
parent1b8e26d7e59d9b76ee88f9135470cb3f11d399cb (diff)
downloadtxr-2707a8937c4b3f969e57f8ab599269feb693e903.tar.gz
txr-2707a8937c4b3f969e57f8ab599269feb693e903.tar.bz2
txr-2707a8937c4b3f969e57f8ab599269feb693e903.zip
Bugfix in regex printing: & operator.
* regex.c (print_rec): Fix checking arg1 for consp but accessing arg2.
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 fc31394c..f1f63873 100644
--- a/regex.c
+++ b/regex.c
@@ -2212,7 +2212,7 @@ static void print_rec(val exp, val stream, int *semi_flag)
} else if (sym == and_s) {
val arg1 = pop(&args);
val arg2 = pop(&args);
- if (consp(arg1) && car(arg2) == or_s)
+ if (consp(arg1) && car(arg1) == or_s)
paren_print_rec(arg1, stream, semi_flag);
else
print_rec(arg1, stream, semi_flag);