Adjusting some indentation.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5741 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-03-17 19:30:29 +00:00
parent 7098dd0cd0
commit e753cd1c38
2 changed files with 43 additions and 47 deletions

View File

@ -3,6 +3,7 @@
a Re-search, to enable cancelling. This fixes Savannah bug #47159. a Re-search, to enable cancelling. This fixes Savannah bug #47159.
* src/search.c (do_replace): Remove two redundant returns. * src/search.c (do_replace): Remove two redundant returns.
* src/search.c (findnextstr): Prune two #ifdefs. * src/search.c (findnextstr): Prune two #ifdefs.
* src/search.c: Adjust some indentation.
2016-03-14 Benno Schulenberg <bensberg@justemail.net> 2016-03-14 Benno Schulenberg <bensberg@justemail.net>
* src/color.c (color_update): Don't dereference a possible NULL. * src/color.c (color_update): Don't dereference a possible NULL.

View File

@ -197,8 +197,8 @@ int search_init(bool replacing, bool use_answer)
backupstring = NULL; backupstring = NULL;
/* Cancel any search, or just return with no previous search. */ /* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && *last_search == '\0') || (!replacing && if (i == -1 || (i < 0 && *last_search == '\0') ||
i == 0 && *answer == '\0')) { (!replacing && i == 0 && *answer == '\0')) {
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
return -1; return -1;
} else { } else {
@ -235,13 +235,11 @@ int search_init(bool replacing, bool use_answer)
} else if (func == do_gotolinecolumn_void) { } else if (func == do_gotolinecolumn_void) {
do_gotolinecolumn(openfile->current->lineno, do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, TRUE, TRUE); openfile->placewewant + 1, TRUE, TRUE);
/* Put answer up on the statusbar and /* Put answer up on the statusbar and fall through. */
* fall through. */
return 3; return 3;
} else { } else
return -1; return -1;
} }
}
return 0; return 0;
} }
@ -380,11 +378,10 @@ bool findnextstr(
if (search_last_line && if (search_last_line &&
#ifndef NANO_TINY #ifndef NANO_TINY
((!ISSET(BACKWARDS_SEARCH) && current_x_find > begin_x) || ((!ISSET(BACKWARDS_SEARCH) && current_x_find > begin_x) ||
(ISSET(BACKWARDS_SEARCH) && current_x_find < begin_x)) (ISSET(BACKWARDS_SEARCH) && current_x_find < begin_x))) {
#else #else
current_x_find > begin_x current_x_find > begin_x) {
#endif #endif
) {
not_found_msg(needle); not_found_msg(needle);
disable_nodelay(); disable_nodelay();
return FALSE; return FALSE;
@ -554,8 +551,7 @@ int replace_regexp(char *string, bool create)
while (*c != '\0') { while (*c != '\0') {
int num = (*(c + 1) - '0'); int num = (*(c + 1) - '0');
if (*c != '\\' || num < 1 || num > 9 || num > if (*c != '\\' || num < 1 || num > 9 || num > search_regexp.re_nsub) {
search_regexp.re_nsub) {
if (create) if (create)
*string++ = *c; *string++ = *c;
c++; c++;
@ -979,8 +975,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
/* Do a bounds check. Display a warning on an out-of-bounds /* Do a bounds check. Display a warning on an out-of-bounds
* line or column number only if we hit Enter at the statusbar * line or column number only if we hit Enter at the statusbar
* prompt. */ * prompt. */
if (!parse_line_column(answer, &line, &column) || line < 1 || if (!parse_line_column(answer, &line, &column) ||
column < 1) { line < 1 || column < 1) {
if (i == 0) if (i == 0)
statusbar(_("Invalid line or column number")); statusbar(_("Invalid line or column number"));
display_main_list(); display_main_list();
@ -1133,8 +1129,7 @@ void do_find_bracket(void)
mbmatchhalf = mbstrlen(matchbrackets) / 2; mbmatchhalf = mbstrlen(matchbrackets) / 2;
for (i = 0; i < mbmatchhalf; i++) for (i = 0; i < mbmatchhalf; i++)
matchhalf += parse_mbchar(matchbrackets + matchhalf, NULL, matchhalf += parse_mbchar(matchbrackets + matchhalf, NULL, NULL);
NULL);
reverse = ((ch - matchbrackets) >= matchhalf); reverse = ((ch - matchbrackets) >= matchhalf);