diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-12-09 20:26:29 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-12-09 20:26:29 +0100 |
commit | b90c3ef48c96c6359f0c815c4e9ce01adb2901df (patch) | |
tree | 18ec6251c542ce81141489f9d59ce939e9fcce5e | |
parent | e8e03e7eda2c6d5fc9e0e5ea13bd46beb4417798 (diff) |
Don’t always assume ‘x’ as the first operator
-rw-r--r-- | grab.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } |