do another int -> bool conversion, and simplify the search/replace

"Cancelled" messages


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-08-26 04:22:54 +00:00
parent fe0d366ce2
commit d1322107a5
3 changed files with 10 additions and 9 deletions

View File

@ -10,6 +10,7 @@ CVS code -
shortcut isn't clicked. New functions get_shortcut(),
get_toggle(), get_edit_input(), and get_edit_mouse(); changes
to do_browser(), do_justify(), do_help(), and main(). (DLR)
- Simplify a few more translated messages. (DLR)
- global.c:
shortcut_init()
- Remove redundant NANO_SMALL #ifdef. (DLR)

View File

@ -391,7 +391,7 @@ void regexp_cleanup(void);
void not_found_msg(const char *str);
void search_abort(void);
void search_init_globals(void);
int search_init(int replacing);
int search_init(bool replacing);
int is_whole_word(int curr_pos, const char *datastr, const char
*searchword);
int findnextstr(int can_display_wrap, int wholeword, const filestruct

View File

@ -110,14 +110,14 @@ void search_init_globals(void)
}
/* Set up the system variables for a search or replace. Return -1 if
* the search should be cancelled (due to Cancel, Go to Line, or a
* failed regcomp()). Return 0 on success, and 1 on rerun calling
* program. Return -2 to run opposite program (search -> replace,
* replace -> search).
* the search should be canceled (due to Cancel, Go to Line, or a failed
* regcomp()). Return 0 on success, and 1 on rerun calling program.
* Return -2 to run opposite program (search -> replace, replace ->
* search).
*
* replacing = 1 if we call from do_replace(), 0 if called from
* replacing is TRUE if we call from do_replace(), FALSE if called from
* do_search(). */
int search_init(int replacing)
int search_init(bool replacing)
{
int i = 0;
char *buf;
@ -194,7 +194,7 @@ int search_init(int replacing)
/* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && last_search[0] == '\0') ||
(!replacing && i == 0 && answer[0] == '\0')) {
statusbar(_("Search Cancelled"));
statusbar(_("Cancelled"));
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
@ -805,7 +805,7 @@ void do_replace(void)
if (i == -1) { /* Cancel. */
if (last_replace[0] != '\0')
answer = mallocstrcpy(answer, last_replace);
statusbar(_("Replace Cancelled"));
statusbar(_("Cancelled"));
}
replace_abort();
return;