commit 8853bc448d74691a6879b6adddf957ef32a41bd2
parent 15148a5e6de8b37a245a0682289f5c0ba0d05b53
Author: Brand Huntsman <alpha@qzx.com>
Date: Sun, 1 Sep 2019 14:14:43 -0600
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 <dwwolfe1@gmail.com>
Signed-off-by: Brand Huntsman <alpha@qzx.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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();