From 8853bc448d74691a6879b6adddf957ef32a41bd2 Mon Sep 17 00:00:00 2001 From: Brand Huntsman Date: Sun, 1 Sep 2019 14:14:43 -0600 Subject: [PATCH] search: accept a match at start of file when searching from command line For a forward search from the command line, pass FALSE to 'skipone' so that an occurrence at the head of the file is not skipped over. This fixes https://savannah.gnu.org/bugs/?56845. Reported-by: Derek Wolfe Signed-off-by: Brand Huntsman --- src/nano.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nano.c b/src/nano.c index 10b70fb2..02701b15 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2631,8 +2631,8 @@ int main(int argc, char **argv) else if (searchstring != NULL) { if (ISSET(USE_REGEXP)) regexp_init(searchstring); - if (!findnextstr(searchstring, FALSE, JUSTFIND, NULL, TRUE, - openfile->filetop, 0)) + if (!findnextstr(searchstring, FALSE, JUSTFIND, NULL, + ISSET(BACKWARDS_SEARCH), openfile->filetop, 0)) not_found_msg(searchstring); else if (lastmessage == HUSH) wipe_statusbar();