diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-05 16:39:34 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-05 16:39:34 +0300 |
commit | f7b04cc09b26a7e1342170129dacf896f50f98b2 (patch) | |
tree | 3eb2e559d136d0ea0802865527f217b79434f3c1 | |
parent | b9e95e79712c1e0021e63204e0d910da2ec2692a (diff) | |
download | grecs-f7b04cc09b26a7e1342170129dacf896f50f98b2.tar.gz grecs-f7b04cc09b26a7e1342170129dacf896f50f98b2.tar.bz2 |
Minor fix in location printer
* src/diag.c (grecs_asprint_locus): Handle the case where beg equals
end.
-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; } |