summaryrefslogtreecommitdiffstats
path: root/src/erec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/erec.c')
-rw-r--r--src/erec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/erec.c b/src/erec.c
index 7c9165c2..32fb079f 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -101,10 +101,11 @@ void print_location(FILE *f, const struct input_descriptor *indesc,
iloc = &tmp->location;
}
}
- if (indesc->name != NULL)
+ if (indesc->type != INDESC_BUFFER && indesc->name) {
fprintf(f, "%s:%u:%u-%u: ", indesc->name,
loc->first_line, loc->first_column,
loc->last_column);
+ }
}
const char *line_location(const struct input_descriptor *indesc,
@@ -145,6 +146,11 @@ void erec_print(struct output_ctx *octx, const struct error_record *erec,
line = indesc->data;
*strchrnul(line, '\n') = '\0';
break;
+ case INDESC_STDIN:
+ line = indesc->data;
+ line += loc->line_offset;
+ *strchrnul(line, '\n') = '\0';
+ break;
case INDESC_FILE:
line = line_location(indesc, loc, buf, sizeof(buf));
break;