diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 13:00:52 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 13:00:52 -0700 |
| commit | 13e1b20f436927e1550a02e7a90653352f70378a (patch) | |
| tree | 2b74ca499d2666bbca33b01a713799e666681c6d | |
| parent | 85dba49b542bed21d67c2b78d15ebaaf07caff97 (diff) | |
Removed escape sequences from string pats (use `bp 'line\nl;line'` or
`bp 'line\(nl)line'` or `bp 'line\\nline'` instead)
| -rw-r--r-- | pattern.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -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 |
