summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/error.c b/error.c
index bf16504..5819e00 100644
--- a/error.c
+++ b/error.c
@@ -211,7 +211,9 @@ static void do_error(int code, va_list ap) {
if (flags & PREFIX)
fputs("halibut: ", stderr);
if (flags & FILEPOS) {
- fprintf(stderr, "%s:%d:", fpos.filename, fpos.line);
+ fprintf(stderr, "%s:", fpos.filename);
+ if (fpos.line > 0)
+ fprintf(stderr, "%d:", fpos.line);
if (fpos.col > 0)
fprintf(stderr, "%d:", fpos.col);
fputc(' ', stderr);