diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 00:14:01 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 00:14:01 -0800 |
| commit | dfdc7bf94a6ec3e5362eb2982d5c5c31edee4239 (patch) | |
| tree | f75267bc34a2d50eafd59d8713a9c8de1543ce16 /print.c | |
| parent | b37c7c3985f54967477df354bd22ab2dae51938e (diff) | |
Fixed error printing code
Diffstat (limited to 'print.c')
| -rw-r--r-- | print.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -378,9 +378,11 @@ void print_match(FILE *out, printer_t *pr, match_t *m) int print_errors(printer_t *pr, match_t *m) { int ret = 0; - if (m->pat->type == BP_CAPTURE && m->pat->args.capture.name && streq(m->pat->args.capture.name, "!")) { + if (m->pat->type == BP_CAPTURE && m->pat->args.capture.name + && strncmp(m->pat->args.capture.name, "!", m->pat->args.capture.namelen) == 0) { printf("\033[31;1m"); - print_match(stdout, pr, m); + printer_t tmp = {.file = pr->file}; // No bells and whistles + print_match(stdout, &tmp, m); // Error message printf("\033[0m\n"); fprint_line(stdout, pr->file, m->start, m->end, " "); return 1; |
