diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-12 20:42:46 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-12 20:42:46 -0800 |
commit | 2f2d54535220da098bd5f470fa8b28684dcc1534 (patch) | |
tree | 2b41299a1626ab8536f887e5e5407ba8ece4368d /regex.c | |
parent | e8a6a7a53407fd4c4adc37e8013baf9bc2e4d553 (diff) | |
download | txr-2f2d54535220da098bd5f470fa8b28684dcc1534.tar.gz txr-2f2d54535220da098bd5f470fa8b28684dcc1534.tar.bz2 txr-2f2d54535220da098bd5f470fa8b28684dcc1534.zip |
Regex printing not escaping [ and ].
* regex.c (print_rec): Handle '[' and ']' in backslash-adding
switch.
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2087,7 +2087,8 @@ static void print_rec(val exp, val stream, int *semi_flag) switch (ch) { case '?': case '.': case '*': case '+': case '(': case ')': case '|': case '~': - case '&': case '%': case '/': case '\\': + case '&': case '%': case '/': + case '[': case ']': case '\\': putc_clear_flag(chr('\\'), stream, semi_flag); put_char(exp, stream); break; |