From 5bd359dbb9427023a90574f2a680bbfe02f0d3f0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 15 Apr 2014 15:02:43 +0000 Subject: [PATCH] Normalizing whitespace around '==' comparison. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 7 ++++--- src/browser.c | 2 +- src/color.c | 2 +- src/files.c | 2 +- src/global.c | 4 ++-- src/help.c | 3 +-- src/nano.c | 4 ++-- src/prompt.c | 12 ++++++------ src/search.c | 2 +- src/text.c | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3196cca..8ff4f7d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,13 +3,14 @@ non-blocking mode for keyboard input. * src/winio.c: Relocate and correct a few comments. * README.SVN: To build nano from svn, ssh is not required. + * src/*.c: Normalize whitespace around '==' comparison. 2014-04-14 Benno Schulenberg * src/{proto.h,cut.c,nano.c,text.c}: Remove the unused parameter 'file_bot' from copy_from_filestruct(), and rename the other. * src/*: Remove the unused parameter 'func_key' from get_shortcut(), and subsequently from parse_browser_input() and parse_help_input(). - * src/*: Whitespace adjustments, plus a few comment tweaks. + * src/*: Adjust some whitespace and tweak a few comments. * src/winio.c (getfuncfromkey): Elide variable and condense comment. * src/text.c (break_line): Initialize a variable to avoid a compiler warning, rename it to be more apt, add a comment, tweak some others, @@ -107,7 +108,7 @@ * src/rcfile.c (check_vitals_mapped): Do not allow 'set quiet' to suppress a fatal-error message, make sure the user sees it. * src/color.c: Comment tweaks. - * src/{*.h,*.c}, configure.ac:Convert all occurrences of + * src/{*.h,*.c}, configure.ac: Convert all occurrences of #ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR. * src/nano.h: Comment tweaks. * configure.ac: Move the enabling stuff to after the disablers. @@ -148,7 +149,7 @@ variable possibly being used uninitialized. 2014-03-31 Chris Allegretta - * doc/syntax/go.nanorc: basic go syntax highlighting + * doc/syntax/go.nanorc: New file, basic go syntax highlighting. 2014-03-30 Benno Schulenberg * doc/syntax/changelog.nanorc: New file, first attempt at colouring diff --git a/src/browser.c b/src/browser.c index 11251c2c..9becdfa2 100644 --- a/src/browser.c +++ b/src/browser.c @@ -844,7 +844,7 @@ int filesearch_init(void) TOGGLE(CASE_SENSITIVE); backupstring = mallocstrcpy(backupstring, answer); return 1; - } else if (s && s->scfunc == backwards_void) { + } else if (s && s->scfunc == backwards_void) { TOGGLE(BACKWARDS_SEARCH); backupstring = mallocstrcpy(backupstring, answer); return 1; diff --git a/src/color.c b/src/color.c index 737dba95..61633aa1 100644 --- a/src/color.c +++ b/src/color.c @@ -397,7 +397,7 @@ void reset_multis(filestruct *fileptr, bool force) * things changed drastically for the precalculated multi values. */ nobegin = regexec(tmpcolor->start, fileptr->data, 1, &startmatch, 0); noend = regexec(tmpcolor->end, fileptr->data, 1, &endmatch, 0); - if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) { + if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) { if (nobegin && noend) continue; } else if (fileptr->multidata[tmpcolor->id] == CNONE) { diff --git a/src/files.c b/src/files.c index e5444b6b..27799fa6 100644 --- a/src/files.c +++ b/src/files.c @@ -2971,7 +2971,7 @@ void load_history(void) if (stat(legacyhist, &hstat) != -1 && stat(nanohist, &hstat) == -1) { - if (rename(legacyhist, nanohist) == -1) + if (rename(legacyhist, nanohist) == -1) history_error(N_("Detected a legacy nano history file (%s) which I tried to move\nto the preferred location (%s) but encountered an error: %s"), legacyhist, nanohist, strerror(errno)); else diff --git a/src/global.c b/src/global.c index 3b3beccf..f1ae3b06 100644 --- a/src/global.c +++ b/src/global.c @@ -269,11 +269,11 @@ void ext_cmd_void(void) /* Set type of function based on the string. */ function_type strtokeytype(const char *str) { - if (str[0] == 'M' || str[0] == 'm') + if (str[0] == 'M' || str[0] == 'm') return META; else if (str[0] == '^') return CONTROL; - else if (str[0] == 'F' || str[0] == 'f') + else if (str[0] == 'F' || str[0] == 'f') return FKEY; else return RAWINPUT; diff --git a/src/help.c b/src/help.c index e1b9c6fa..da643509 100644 --- a/src/help.c +++ b/src/help.c @@ -398,9 +398,8 @@ void help_init(void) size_t endis_len = strlen(_("enable/disable")); for (s = sclist; s != NULL; s = s->next) - if (s->scfunc == do_toggle_void) + if (s->scfunc == do_toggle_void) allocsize += strlen(_(flagtostr(s->toggle))) + endis_len + 9; - } #endif diff --git a/src/nano.c b/src/nano.c index 65ab07af..c7799267 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1891,7 +1891,7 @@ void precalc_multicolorinfo(void) goto precalc_cleanup; } - while ((nostart = regexec(tmpcolor->start, &fileptr->data[startx], 1, &startmatch, 0)) == 0) { + while ((nostart = regexec(tmpcolor->start, &fileptr->data[startx], 1, &startmatch, 0)) == 0) { /* Look for end, and start marking how many lines are * encompassed which should speed up rendering later. */ startx += startmatch.rm_eo; @@ -1900,7 +1900,7 @@ void precalc_multicolorinfo(void) #endif /* Look on this line first for end. */ - if (regexec(tmpcolor->end, &fileptr->data[startx], 1, &endmatch, 0) == 0) { + if (regexec(tmpcolor->end, &fileptr->data[startx], 1, &endmatch, 0) == 0) { startx += endmatch.rm_eo; fileptr->multidata[tmpcolor->id] |= CSTARTENDHERE; #ifdef DEBUG diff --git a/src/prompt.c b/src/prompt.c index 367c1a45..006780e3 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -126,7 +126,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, /* If we got a shortcut, or if there aren't any other characters * waiting after the one we read in, we need to display all the * characters in the input buffer if it isn't empty. */ - if (*have_shortcut || get_key_buffer_len() == 0) { + if (*have_shortcut || get_key_buffer_len() == 0) { if (kbinput != NULL) { /* Display all the characters in the input buffer at * once, filtering out control characters. */ @@ -226,8 +226,8 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, * that we're done after running or trying to run their * associated functions. */ f = sctofunc((sc *) s); - if (s->scfunc != 0 && s->execute == TRUE) { - *ran_func = TRUE; + if (s->scfunc != 0 && s->execute == TRUE) { + *ran_func = TRUE; if (f && (!ISSET(VIEW_MODE) || (f->viewok))) f->scfunc(); } @@ -1099,7 +1099,7 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe * we've finished putting in an answer, reset the statusbar cursor * position too. */ if (s) { - if (s->scfunc == do_cancel || s->scfunc == do_enter_void || + if (s->scfunc == do_cancel || s->scfunc == do_enter_void || ran_func) { statusbar_x = old_statusbar_x; statusbar_pww = old_pww; @@ -1186,7 +1186,7 @@ int do_prompt(bool allow_tabs, /* If we left the prompt via Cancel or Enter, set the return value * properly. */ - if (s && s->scfunc == do_cancel) + if (s && s->scfunc == do_cancel) retval = -1; else if (s && s->scfunc == do_enter_void) retval = (*answer == '\0') ? -2 : 0; @@ -1296,7 +1296,7 @@ int do_yesno_prompt(bool all, const char *msg) kbinput = get_kbinput(bottomwin, &meta_key, &func_key); s = get_shortcut(currmenu, &kbinput, &meta_key); - if (s && s->scfunc == do_cancel) + if (s && s->scfunc == do_cancel) ok = -1; #ifndef DISABLE_MOUSE else if (kbinput == KEY_MOUSE) { diff --git a/src/search.c b/src/search.c index 9a5a37c7..0673f7aa 100644 --- a/src/search.c +++ b/src/search.c @@ -1044,7 +1044,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, s = get_shortcut(currmenu, &i, &meta_key); - if (s && s->scfunc == gototext_void) { + if (s && s->scfunc == gototext_void) { /* Keep answer up on the statusbar. */ search_init(TRUE, TRUE); diff --git a/src/text.c b/src/text.c index ac53b0a0..9c7cb42a 100644 --- a/src/text.c +++ b/src/text.c @@ -145,7 +145,7 @@ void do_delete(void) set_modified(); - if (edit_refresh_needed == FALSE) + if (edit_refresh_needed == FALSE) update_line(openfile->current, openfile->current_x); } @@ -2705,7 +2705,7 @@ const char *do_int_speller(const char *tempfile_name) if (WIFEXITED(spell_status) == 0 || WEXITSTATUS(spell_status)) return _("Error invoking \"spell\""); - if (WIFEXITED(sort_status) == 0 || WEXITSTATUS(sort_status)) + if (WIFEXITED(sort_status) == 0 || WEXITSTATUS(sort_status)) return _("Error invoking \"sort -f\""); if (WIFEXITED(uniq_status) == 0 || WEXITSTATUS(uniq_status)) -- 2.39.5