Deleting an always-FALSE parameter.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-04-25 15:17:22 +00:00
parent af708843f6
commit b454d9c89b
4 changed files with 12 additions and 20 deletions

View File

@ -1,6 +1,7 @@
2015-04-25 Benno Schulenberg <bensberg@justemail.net>
* 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 <bensberg@justemail.net>
* src/browser.c (findnextfile): Save the settings of the global

View File

@ -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)

View File

@ -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

View File

@ -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();