diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-23 02:23:12 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-23 02:24:33 +0100 |
commit | de858f60d1cbe45cd24f7b65a89f79a2e86acf08 (patch) | |
tree | d2c10d2a4403ec9a7191432d37bc954af477692b /src/grab.c | |
parent | e7f82626820f8a655a4015671185aefad037e78e (diff) |
Disallow h// at the start of patterns
Diffstat (limited to 'src/grab.c')
-rw-r--r-- | src/grab.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -302,6 +302,8 @@ comppat(char8_t *s) if (s - p == 0) { if (op.c != 'h') diex("Empty regex given to ‘%c’", op.c); + if (ops.len == 0) + diex("Empty ‘h’ is not allowed as the first operator"); op.pat = ops.buf[ops.len - 1].pat; } else op.pat = mkregex(p, s - p); |