aboutsummaryrefslogtreecommitdiff
path: root/compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler.c')
-rw-r--r--compiler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler.c b/compiler.c
index a0ff087..60da7d8 100644
--- a/compiler.c
+++ b/compiler.c
@@ -395,6 +395,12 @@ vm_op_t *bpeg_stringpattern(file_t *f, const char *str)
for (; *str; str++) {
if (*str == '\\') {
check(str[1], "Expected more string contents after backslash");
+ const char *after_escape;
+ char e = unescapechar(&str[1], &after_escape);
+ if (e != str[1]) {
+ str = after_escape - 1;
+ continue;
+ }
if (str[1] == '\\') {
++str;
continue;