From b90c3ef48c96c6359f0c815c4e9ce01adb2901df Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 9 Dec 2023 20:26:29 +0100 Subject: Don’t always assume ‘x’ as the first operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grab.c | 9 +++++++-- 1 file 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); } -- cgit v1.2.3