From: Benno Schulenberg Date: Thu, 31 Mar 2016 11:27:16 +0000 (+0000) Subject: Renaming a variable, and adjusting whitespace after the previous change. X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=nano.git Renaming a variable, and adjusting whitespace after the previous change. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5782 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index ec4f7a67..8a157251 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2016-03-31 Benno Schulenberg - * src/text.c (do_int_spell_fix): Replace a fake 'while' and delete - a redundant 'if' -- we searched for whole words only, so it will be. + * src/text.c (do_int_spell_fix): Replace a fake 'while', delete a + redundant 'if', rename a variable, and adjust whitespace. 2016-03-30 Benno Schulenberg * src/search.c (do_replace_loop, go_looking, findnextstr): Report diff --git a/src/text.c b/src/text.c index 42c33bf8..78a56a71 100644 --- a/src/text.c +++ b/src/text.c @@ -2359,8 +2359,8 @@ bool do_int_spell_fix(const char *word) filestruct *edittop_save = openfile->edittop; filestruct *current_save = openfile->current; /* Save where we are. */ - bool canceled = FALSE; - /* The inverse of this function's return value. */ + bool proceed = TRUE; + /* The return value of this function. */ bool result; /* The return value of searching for a misspelled word. */ unsigned stash[sizeof(flags) / sizeof(flags[0])]; @@ -2432,31 +2432,31 @@ bool do_int_spell_fix(const char *word) strnlenpt(openfile->current->data, openfile->current_x + match_len) - xplustabs(), FALSE); - edit_refresh(); + edit_refresh(); - spotlight(TRUE, exp_word); + spotlight(TRUE, exp_word); /* Let the user supply a correctly spelled alternative. */ - canceled = (do_prompt(FALSE, + proceed = (do_prompt(FALSE, #ifndef DISABLE_TABCOMP - TRUE, + TRUE, #endif - MSPELL, word, + MSPELL, word, #ifndef DISABLE_HISTORIES - NULL, + NULL, #endif - edit_refresh, _("Edit a replacement")) == -1); + edit_refresh, _("Edit a replacement")) != -1); - spotlight(FALSE, exp_word); + spotlight(FALSE, exp_word); - free(exp_word); + free(exp_word); /* If a replacement was given, go through all occurrences. */ - if (!canceled && strcmp(word, answer) != 0) { - openfile->current_x--; - do_replace_loop(TRUE, openfile->current, - &openfile->current_x, word); - } + if (proceed && strcmp(word, answer) != 0) { + openfile->current_x--; + do_replace_loop(TRUE, openfile->current, + &openfile->current_x, word); + } } #ifndef NANO_TINY @@ -2497,7 +2497,7 @@ bool do_int_spell_fix(const char *word) /* Restore the settings of the global flags. */ memcpy(flags, stash, sizeof(flags)); - return !canceled; + return proceed; } /* Internal (integrated) spell checking using the spell program,