From b454d9c89b1b27b615de25646d2e6ecd9bafdd74 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 25 Apr 2015 15:17:22 +0000 Subject: [PATCH] Deleting an always-FALSE parameter. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/proto.h | 4 ++-- src/search.c | 24 ++++++++---------------- src/text.c | 3 +-- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12dd260f..a369db18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2015-04-25 Benno Schulenberg * src/search.c (do_replace_loop): Remove the unintended special case for replacing multiple occurrences of a literal ^ or $. + * src/search.c (findnextstr): Delete an always-FALSE parameter. 2015-04-21 Benno Schulenberg * src/browser.c (findnextfile): Save the settings of the global diff --git a/src/proto.h b/src/proto.h index b786e118..4e8d13ad 100644 --- a/src/proto.h +++ b/src/proto.h @@ -584,8 +584,8 @@ bool findnextstr( #ifndef DISABLE_SPELLER bool whole_word, #endif - bool no_sameline, const filestruct *begin, size_t begin_x, const - char *needle, size_t *needle_len); + const filestruct *begin, size_t begin_x, + const char *needle, size_t *needle_len); void findnextstr_wrap_reset(void); void do_search(void); #if !defined(NANO_TINY) || !defined(DISABLE_BROWSER) diff --git a/src/search.c b/src/search.c index 94d37d66..b3c49710 100644 --- a/src/search.c +++ b/src/search.c @@ -249,8 +249,7 @@ int search_init(bool replacing, bool use_answer) return 0; } -/* Look for needle, starting at (current, current_x). If no_sameline is - * TRUE, skip over begin when looking for needle. begin is the line +/* Look for needle, starting at (current, current_x). begin is the line * where we first started searching, at column begin_x. The return * value specifies whether we found anything. If we did, set needle_len * to the length of the string we found if it isn't NULL. */ @@ -258,8 +257,8 @@ bool findnextstr( #ifndef DISABLE_SPELLER bool whole_word, #endif - bool no_sameline, const filestruct *begin, size_t begin_x, const - char *needle, size_t *needle_len) + const filestruct *begin, size_t begin_x, + const char *needle, size_t *needle_len) { size_t found_len; /* The length of the match we find. */ @@ -324,17 +323,11 @@ bool findnextstr( fileptr->data, word); free(word); } -#endif /* If we're searching for whole words and this potential - * match isn't a whole word, or if we're not allowed to find - * a match on the same line we started on and this potential - * match is on that line, continue searching. */ - if ( -#ifndef DISABLE_SPELLER - (!whole_word || found_whole) && + * match isn't a whole word, continue searching. */ + if (!whole_word || found_whole) #endif - (!no_sameline || fileptr != openfile->current)) break; } @@ -467,7 +460,7 @@ void do_search(void) #ifndef DISABLE_SPELLER FALSE, #endif - FALSE, openfile->current, openfile->current_x, answer, NULL); + openfile->current, openfile->current_x, answer, NULL); /* If we found something, and we're back at the exact same spot where * we started searching, then this is the only occurrence. */ @@ -504,8 +497,7 @@ void do_research(void) #ifndef DISABLE_SPELLER FALSE, #endif - FALSE, openfile->current, openfile->current_x, - last_search, NULL); + openfile->current, openfile->current_x, last_search, NULL); /* If we found something, and we're back at the exact same spot * where we started searching, then this is the only occurrence. */ @@ -665,7 +657,7 @@ ssize_t do_replace_loop( #ifndef DISABLE_SPELLER whole_word, #endif - FALSE, real_current, *real_current_x, needle, &match_len)) { + real_current, *real_current_x, needle, &match_len)) { int i = 0; #ifndef NANO_TINY diff --git a/src/text.c b/src/text.c index 583c8ccd..245d0e64 100644 --- a/src/text.c +++ b/src/text.c @@ -2389,8 +2389,7 @@ bool do_int_spell_fix(const char *word) /* Find the first whole occurrence of word. */ findnextstr_wrap_reset(); - while (findnextstr(TRUE, FALSE, openfile->fileage, 0, word, - &match_len)) { + while (findnextstr(TRUE, openfile->fileage, 0, word, &match_len)) { if (is_whole_word(openfile->current_x, openfile->current->data, word)) { size_t xpt = xplustabs(); -- 2.39.5