aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-12-09 20:26:29 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-12-09 20:26:29 +0100
commitb90c3ef48c96c6359f0c815c4e9ce01adb2901df (patch)
tree18ec6251c542ce81141489f9d59ce939e9fcce5e
parente8e03e7eda2c6d5fc9e0e5ea13bd46beb4417798 (diff)
Don’t always assume ‘x’ as the first operator
-rw-r--r--grab.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/grab.c b/grab.c
index 9fdfbd0..74f7e44 100644
--- a/grab.c
+++ b/grab.c
@@ -175,8 +175,13 @@ grab(struct ops ops, FILE *stream, const char *filename)
if (ferror(stream)) {
warn("fread: %s", filename);
rv = EXIT_FAILURE;
- } else
- cmdx((struct sv){.p = chars.buf, .len = chars.len}, ops, 0);
+ } else {
+ struct sv sv = {
+ .p = chars.buf,
+ .len = chars.len,
+ };
+ op_table[(uchar)ops.buf[0].c](sv, ops, 0);
+ }
free(chars.buf);
}