mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
Hack bugfix for multiline off-by-one (locfile.c)
This commit is contained in:
@ -66,8 +66,8 @@ static void locfile_locate(struct locfile* l, location loc, const char* fmt, ...
|
||||
}
|
||||
int startline = locfile_get_line(l, loc.start);
|
||||
int offset = l->linemap[startline];
|
||||
fprintf(stderr, "%.*s\n", locfile_line_length(l, startline), l->data + offset);
|
||||
fprintf(stderr, "%*s", loc.start - offset, "");
|
||||
fprintf(stderr, "%.*s\n", locfile_line_length(l, startline)-(startline!=0), l->data + offset +(startline!=0));
|
||||
fprintf(stderr, "%*s", loc.start - offset -(startline!=0), "");
|
||||
for (int i = loc.start;
|
||||
i < loc.end && i < offset + locfile_line_length(l, startline);
|
||||
i++){
|
||||
|
Reference in New Issue
Block a user