aboutsummaryrefslogtreecommitdiff
path: root/src/grab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/grab.c')
-rw-r--r--src/grab.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/grab.c b/src/grab.c
index dbed779..83d3aba 100644
--- a/src/grab.c
+++ b/src/grab.c
@@ -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;