diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 22:22:05 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-28 22:22:05 -0700 |
| commit | f2f10586bb446cf3c6a3d7cc0965005e94dfcc81 (patch) | |
| tree | 6ce6d6647fc3c1d24ffe4c0825bef4460eaa574d | |
| parent | f7430e443a8882021d619ecf51f95ee682e5d27d (diff) | |
Bugfixes
| -rw-r--r-- | bpeg.c | 7 | ||||
| -rw-r--r-- | vm.c | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -180,10 +180,11 @@ int main(int argc, char *argv[]) } if (isatty(STDOUT_FILENO)) { - file_t *is_tty_file = spoof_file("<is-tty>", flag); - vm_op_t *p = bpeg_pattern(is_tty_file, "''"); + char *epsilon = "''"; + file_t *is_tty_file = spoof_file("<is-tty>", epsilon); + vm_op_t *p = bpeg_pattern(is_tty_file, epsilon); check(p, "Failed to compile is-tty"); - add_def(g, is_tty_file, "''", "is-tty", p); + add_def(g, is_tty_file, epsilon, "is-tty", p); } vm_op_t *pattern = lookup(g, rule); @@ -545,7 +545,7 @@ static match_t *get_cap(match_t *m, const char **r) match_t *cap = get_capture_named(m, name); free(name); *r = end; - if (*end == ';') ++(*r); + if (**r == ';') ++(*r); return cap; } return NULL; |
