diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-22 13:37:49 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-22 13:37:49 +0100 |
commit | 230b8f6f2eb7e603dd3a90f975fd9e98c2ce6e0f (patch) | |
tree | e023a3b02ea7be98d321513f52ee94fe0931cbe2 /src | |
parent | 912da4241774194c9cbb4bfca13384b14c5211aa (diff) |
Ignore 0-length matches when using X//
Diffstat (limited to 'src')
-rw-r--r-- | src/grab.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -389,10 +389,13 @@ cmdX(struct sv sv, struct ops ops, size_t i, const char *filename) .p = sv.p + prev.rm_eo, .len = rm.rm_so - prev.rm_eo, }; - if (i + 1 == ops.len) - putf(nsv, nullptr, filename); - else - op_table[(uchar)ops.buf[i + 1].c](nsv, ops, i + 1, filename); + if (nsv.len) { + if (i + 1 == ops.len) + putf(nsv, nullptr, filename); + else + op_table[(uchar)ops.buf[i + 1].c](nsv, ops, i + 1, + filename); + } } prev = rm; |