summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-12 05:37:55 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-12 05:37:55 -0800
commit5f9fd6726e36b4746acb5a098d5c1c2582c19d91 (patch)
tree6f9a17975c0add3c8acdba6ac8d1abdd1f05bae0 /regex.c
parentc48937aba802ade5c256aac15fc4cc6f70eeba56 (diff)
downloadtxr-5f9fd6726e36b4746acb5a098d5c1c2582c19d91.tar.gz
txr-5f9fd6726e36b4746acb5a098d5c1c2582c19d91.tar.bz2
txr-5f9fd6726e36b4746acb5a098d5c1c2582c19d91.zip
regex_print: [ and ] in char class must be escaped.
* regex.c (print_class_char): Add missing character cases.
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 a1294ca9..4d6a60eb 100644
--- a/regex.c
+++ b/regex.c
@@ -2037,7 +2037,7 @@ static void print_class_char(val ch, val first_p, val stream)
if (!first_p)
break;
/* fallthrough */
- case '-':
+ case '-': case '[': case ']':
put_char(chr('\\'), stream);
break;
}