Commit c24432ed authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

linting: don't try to put the cursor at a negative x position

Human column numbers are one-based, whereas x positions are zero-based.
Converting from the one to the other involves subtracting one.  But when
the linter message does not provide a column number, the latter defaults
to zero.  Catch that case and change the number to one.

This fixes https://savannah.gnu.org/bugs/?51550.
No related merge requests found
Showing with 2 additions and 1 deletion
+2 -1
......@@ -3183,7 +3183,8 @@ void do_linter(void)
if ((tmplinecol = strtok(NULL, ",")) != NULL)
tmpcolno = strtol(tmplinecol, NULL, 10);
}
if (tmpcolno <= 0)
tmpcolno = 1;
#ifdef DEBUG
fprintf(stderr, "text.c:do_lint:Successful parse! %ld:%ld:%s\n", (long)tmplineno, (long)tmpcolno, message);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment