diff options
-rw-r--r-- | src/diag.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -96,11 +96,17 @@ grecs_asprint_locus(char **locstr, size_t *size, grecs_locus_t const *locus) locus->beg.file, locus->beg.line, locus->beg.col, locus->end.line, locus->end.col); - else + else if (locus->beg.col != locus->end.col) rc = grecs_asprintf(locstr, size, "%s:%u.%u-%u", locus->beg.file, locus->beg.line, locus->beg.col, locus->end.col); + else + rc = grecs_asprintf(locstr, size, "%s:%u.%u", + locus->beg.file, + locus->beg.line, + locus->beg.col); + return rc; } |