Renaming the parameter 'whole_word' to 'whole_word_only',
because the first sounds too much like "found_whole" to me. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5216 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
b454d9c89b
Коммит
df7524d7e8
@ -2,6 +2,8 @@
|
||||
* 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.
|
||||
* src/search.c (findnextstr): Rename the parameter 'whole_word'
|
||||
to 'whole_word_only', for clarity.
|
||||
|
||||
2015-04-21 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/browser.c (findnextfile): Save the settings of the global
|
||||
|
@ -582,7 +582,7 @@ void search_replace_abort(void);
|
||||
int search_init(bool replacing, bool use_answer);
|
||||
bool findnextstr(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word,
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
const filestruct *begin, size_t begin_x,
|
||||
const char *needle, size_t *needle_len);
|
||||
@ -597,7 +597,7 @@ int replace_regexp(char *string, bool create);
|
||||
char *replace_line(const char *needle);
|
||||
ssize_t do_replace_loop(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word,
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
bool *canceled, const filestruct *real_current, size_t
|
||||
*real_current_x, const char *needle);
|
||||
|
10
src/search.c
10
src/search.c
@ -255,7 +255,7 @@ int search_init(bool replacing, bool use_answer)
|
||||
* to the length of the string we found if it isn't NULL. */
|
||||
bool findnextstr(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word,
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
const filestruct *begin, size_t begin_x,
|
||||
const char *needle, size_t *needle_len)
|
||||
@ -315,7 +315,7 @@ bool findnextstr(
|
||||
#ifndef DISABLE_SPELLER
|
||||
/* If we're searching for whole words, see if this potential
|
||||
* match is a whole word. */
|
||||
if (whole_word) {
|
||||
if (whole_word_only) {
|
||||
char *word = mallocstrncpy(NULL, found, found_len + 1);
|
||||
word[found_len] = '\0';
|
||||
|
||||
@ -326,7 +326,7 @@ bool findnextstr(
|
||||
|
||||
/* If we're searching for whole words and this potential
|
||||
* match isn't a whole word, continue searching. */
|
||||
if (!whole_word || found_whole)
|
||||
if (!whole_word_only || found_whole)
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@ -616,7 +616,7 @@ char *replace_line(const char *needle)
|
||||
* canceled isn't NULL, set it to TRUE if we canceled. */
|
||||
ssize_t do_replace_loop(
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool whole_word,
|
||||
bool whole_word_only,
|
||||
#endif
|
||||
bool *canceled, const filestruct *real_current, size_t
|
||||
*real_current_x, const char *needle)
|
||||
@ -655,7 +655,7 @@ ssize_t do_replace_loop(
|
||||
findnextstr_wrap_reset();
|
||||
while (findnextstr(
|
||||
#ifndef DISABLE_SPELLER
|
||||
whole_word,
|
||||
whole_word_only,
|
||||
#endif
|
||||
real_current, *real_current_x, needle, &match_len)) {
|
||||
int i = 0;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user