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 /src | |
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.
Diffstat (limited to 'src')
-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) | |||
96 | locus->beg.file, | 96 | locus->beg.file, |
97 | locus->beg.line, locus->beg.col, | 97 | locus->beg.line, locus->beg.col, |
98 | locus->end.line, locus->end.col); | 98 | locus->end.line, locus->end.col); |
99 | else | 99 | else if (locus->beg.col != locus->end.col) |
100 | rc = grecs_asprintf(locstr, size, "%s:%u.%u-%u", | 100 | rc = grecs_asprintf(locstr, size, "%s:%u.%u-%u", |
101 | locus->beg.file, | 101 | locus->beg.file, |
102 | locus->beg.line, locus->beg.col, | 102 | locus->beg.line, locus->beg.col, |
103 | locus->end.col); | 103 | locus->end.col); |
104 | else | ||
105 | rc = grecs_asprintf(locstr, size, "%s:%u.%u", | ||
106 | locus->beg.file, | ||
107 | locus->beg.line, | ||
108 | locus->beg.col); | ||
109 | |||
104 | return rc; | 110 | return rc; |
105 | } | 111 | } |
106 | 112 | ||