From 03c3e2b7c0fd5cd97944f882af5a14cf3b4250cc Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 5 May 2017 15:48:54 -0500 Subject: [PATCH] tweaks: fix several whitespace irregularities Add missing spaces, remove excess spaces, and replace groups of indentation spaces with tabs. --- src/chars.c | 2 +- src/files.c | 2 +- src/global.c | 2 +- src/nano.c | 4 ++-- src/prompt.c | 2 +- src/utils.c | 47 +++++++++++++++++++++++------------------------ src/winio.c | 2 +- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/chars.c b/src/chars.c index 7087eace..30b7d2f2 100644 --- a/src/chars.c +++ b/src/chars.c @@ -390,7 +390,7 @@ size_t move_mbleft(const char *buf, size_t pos) before = pos - 2; else if ((signed char)*(--ptr) > -65) before = pos - 3; - else if ((signed char)*(--ptr) > -65) + else if ((signed char)*(--ptr) > -65) before = pos - 4; else before = pos - 1; diff --git a/src/files.c b/src/files.c index a90c2498..4a254cc6 100644 --- a/src/files.c +++ b/src/files.c @@ -3075,7 +3075,7 @@ bool has_old_position(const char *file, ssize_t *line, ssize_t *column) free(fullpath); if (posptr == NULL) - return FALSE; + return FALSE; *line = posptr->lineno; *column = posptr->xno; diff --git a/src/global.c b/src/global.c index 79b1e8ea..3836406e 100644 --- a/src/global.c +++ b/src/global.c @@ -728,7 +728,7 @@ void shortcut_init(void) add_to_funcs(do_research, MHELP, whereis_next_tag, "x", 0, VIEW); add_to_funcs(do_up_void, MHELP, prev_line_tag, "x", 0, VIEW); - add_to_funcs(do_down_void, MHELP, next_line_tag, "x" , 0, VIEW); + add_to_funcs(do_down_void, MHELP, next_line_tag, "x", 0, VIEW); #endif add_to_funcs(do_cut_text_void, MMAIN, diff --git a/src/nano.c b/src/nano.c index 15c55afc..b8365bb7 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1386,7 +1386,7 @@ void do_toggle(int flag) case MORE_SPACE: case NO_HELP: window_init(); - focusing=FALSE; + focusing = FALSE; total_refresh(); break; case SUSPEND: @@ -1620,7 +1620,7 @@ int do_input(bool allow_funcs) /* If the keystroke isn't a shortcut nor a toggle, it's a normal text * character: add the character to the input buffer -- or display a * warning when we're in view mode. */ - if (input != ERR && !have_shortcut) { + if (input != ERR && !have_shortcut) { if (ISSET(VIEW_MODE)) print_view_warning(); else { diff --git a/src/prompt.c b/src/prompt.c index 4a269541..62c0702a 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -95,7 +95,7 @@ int do_statusbar_input(bool *ran_func, bool *finished) kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int)); kbinput[kbinput_len - 1] = input; } - } + } /* If we got a shortcut, or if there aren't any other keystrokes waiting * after the one we read in, we need to insert all the characters in the diff --git a/src/utils.c b/src/utils.c index da2504d6..e7f8340c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -60,30 +60,29 @@ void get_homedir(void) int digits(ssize_t n) { if (n < 100000) { - if (n < 1000) { - if (n < 100) - return 2; - else - return 3; - } else { - if (n < 10000) - return 4; - else - return 5; - } + if (n < 1000) { + if (n < 100) + return 2; + else + return 3; + } else { + if (n < 10000) + return 4; + else + return 5; + } } else { - if (n < 10000000) { - if (n < 1000000) - return 6; - else - return 7; - } - else { - if (n < 100000000) - return 8; - else - return 9; - } + if (n < 10000000) { + if (n < 1000000) + return 6; + else + return 7; + } else { + if (n < 100000000) + return 8; + else + return 9; + } } } #endif @@ -117,7 +116,7 @@ bool parse_line_column(const char *str, ssize_t *line, ssize_t *column) const char *comma; while (*str == ' ') - str++; + str++; comma = strpbrk(str, "m,. /;"); diff --git a/src/winio.c b/src/winio.c index fd5993c2..5ece3f61 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2014,7 +2014,7 @@ void titlebar(const char *path) prefixlen = strlenpt(prefix); if (prefixlen > 0) prefixlen++; - pathlen= strlenpt(path); + pathlen = strlenpt(path); statelen = strlenpt(state) + 2; if (statelen > 2) { pathlen++;