mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
diagnostics: style: minor changes
* src/location.c (location_caret): Factor two branches of an if.
This commit is contained in:
@@ -235,14 +235,12 @@ location_caret (location loc, const char *style, FILE *out)
|
|||||||
/* If the line we want to quote is seekable (the same line as the previous
|
/* If the line we want to quote is seekable (the same line as the previous
|
||||||
location), just seek it. If it was a previous line, we lost track of it,
|
location), just seek it. If it was a previous line, we lost track of it,
|
||||||
so return to the start of file. */
|
so return to the start of file. */
|
||||||
if (caret_info.line <= loc.start.line)
|
if (loc.start.line < caret_info.line)
|
||||||
fseek (caret_info.source, caret_info.offset, SEEK_SET);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
caret_info.line = 1;
|
caret_info.line = 1;
|
||||||
caret_info.offset = 0;
|
caret_info.offset = 0;
|
||||||
fseek (caret_info.source, caret_info.offset, SEEK_SET);
|
|
||||||
}
|
}
|
||||||
|
fseek (caret_info.source, caret_info.offset, SEEK_SET);
|
||||||
|
|
||||||
/* Advance to the line's position, keeping track of the offset. */
|
/* Advance to the line's position, keeping track of the offset. */
|
||||||
while (caret_info.line < loc.start.line)
|
while (caret_info.line < loc.start.line)
|
||||||
|
|||||||
Reference in New Issue
Block a user