aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diag.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/diag.c b/src/diag.c
index db96e75..39089c4 100644
--- a/src/diag.c
+++ b/src/diag.c
@@ -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;
}

Return to:

Send suggestions and report system problems to the System administrator.