nano

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

commit e1ce92c90f973a82c7388e2dcff100c0e3aff6f4
parent c5659d320e8c5180a8c2736b7c3c293c4979006f
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue, 17 May 2005 01:55:44 +0000

in do_gotoline(), properly show an error message if we try to go to line
0, since the first line in the file is 1


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2520 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 4++++
Msrc/search.c | 2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -58,6 +58,10 @@ CVS code - do_output() - Properly allow wrapping when we insert a tab, for consistency. (DLR) +- search.c: + do_gotoline() + - Properly show an error message if we try to go to line 0, + since the first line in the file is 1. (DLR) - utils.c: num_of_digits() - Use a size_t instead of an int, and rename to digits(). (DLR) diff --git a/src/search.c b/src/search.c @@ -997,7 +997,7 @@ void do_gotoline(int line, bool save_pos) /* Do a bounds check. Display a warning on an out-of-bounds * line number only if we hit Enter at the statusbar prompt. */ - if (!parse_num(answer, &line) || line < 0) { + if (!parse_num(answer, &line) || line < 1) { if (i == 0) statusbar(_("Come on, be reasonable")); display_main_list();