aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-18 01:21:47 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-18 01:21:47 +0100
commitbcda8465441452f9b55eba2c74acfb87321f2a13 (patch)
tree22f739a4fc2dffe67a6d636448d12508658eb4b9 /src
parent0ddd4548a4df5bac6a61e9c4adff67eeb186a447 (diff)
Remove manual escape handling
This is all handled for us by the PCRE2 library
Diffstat (limited to 'src')
-rw-r--r--src/grab.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/grab.c b/src/grab.c
index 6d43be6..8df2684 100644
--- a/src/grab.c
+++ b/src/grab.c
@@ -94,11 +94,6 @@ static const cmd_func op_table[UCHAR_MAX] = {
['y'] = cmdy,
};
-static const char esc_table[UCHAR_MAX] = {
- ['\\'] = '\\', ['a'] = '\a', ['b'] = '\b', ['f'] = '\f',
- ['n'] = '\n', ['r'] = '\r', ['t'] = '\t', ['v'] = '\v',
-};
-
static void
usage(const char *s)
{
@@ -459,18 +454,6 @@ mkregex(char *s, size_t n)
int ret, cflags;
regex_t r;
- for (size_t i = 0; i < n - 1; i++) {
- if (s[i] == '\\') {
- char c = esc_table[(uchar)s[i + 1]];
- if (c) {
- for (size_t j = i; j < n - 1; j++)
- s[j] = s[j + 1];
- s[i] = c;
- n--;
- }
- }
- }
-
s[n] = 0;
cflags = REG_EXTENDED;
if (nflag)