nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c24432edc41266ef60ab6d1d29a1fdccca0ce338
parent 85bffcfeb9dcd187f766d55412cdc13bf68d3ab0
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 26 Jul 2017 21:23:31 +0200

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.

Diffstat:
Msrc/text.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c @@ -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