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.
master
Benno Schulenberg 2017-07-26 21:23:31 +02:00
parent 85bffcfeb9
commit c24432edc4
1 changed files with 2 additions and 1 deletions

View File

@ -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