From 13e1b20f436927e1550a02e7a90653352f70378a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 20 May 2021 13:00:52 -0700 Subject: Removed escape sequences from string pats (use `bp 'line\nl;line'` or `bp 'line\(nl)line'` or `bp 'line\\nline'` instead) --- pattern.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'pattern.c') diff --git a/pattern.c b/pattern.c index d0a8e99..7108ab1 100644 --- a/pattern.c +++ b/pattern.c @@ -513,19 +513,9 @@ pat_t *bp_stringpattern(file_t *f, const char *str) pat_t *interp = NULL; for (; str < f->end; str++) { if (*str == '\\' && str+1 < f->end) { - char e = unescapechar(&str[1], NULL); - // If there is not a special escape sequence (\n, \x0A, \N, - // etc.) or \\, then check for an interpolated value: - if (e != str[1] || e == '\\' || e == 'N') { - interp = bp_simplepattern(f, str); - if (!interp) - errx(EXIT_FAILURE, "Failed to match pattern %.*s", 2, str); - break; - } else { - interp = bp_simplepattern(f, str + 1); - if (interp) break; - // If there is no interpolated value, this is just a plain ol' regular backslash - } + interp = bp_simplepattern(f, str + 1); + if (interp) break; + // If there is no interpolated value, this is just a plain ol' regular backslash } } // End of string -- cgit v1.2.3