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.
* src/search.c (do_replace): Remove two redundant returns.
* src/search.c (findnextstr): Prune two #ifdefs.
* src/search.c: Adjust some indentation.
2016-03-14 Benno Schulenberg <bensberg@justemail.net>
* 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;
/* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && *last_search == '\0') || (!replacing &&
i == 0 && *answer == '\0')) {
if (i == -1 || (i < 0 && *last_search == '\0') ||
(!replacing && i == 0 && *answer == '\0')) {
statusbar(_("Cancelled"));
return -1;
} else {
@ -235,13 +235,11 @@ int search_init(bool replacing, bool use_answer)
} else if (func == do_gotolinecolumn_void) {
do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, TRUE, TRUE);
/* Put answer up on the statusbar and
* fall through. */
/* Put answer up on the statusbar and fall through. */
return 3;
} else {
} else
return -1;
}
}
return 0;
}
@ -380,11 +378,10 @@ bool findnextstr(
if (search_last_line &&
#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))) {
#else
current_x_find > begin_x
current_x_find > begin_x) {
#endif
) {
not_found_msg(needle);
disable_nodelay();
return FALSE;
@ -554,8 +551,7 @@ int replace_regexp(char *string, bool create)
while (*c != '\0') {
int num = (*(c + 1) - '0');
if (*c != '\\' || num < 1 || num > 9 || num >
search_regexp.re_nsub) {
if (*c != '\\' || num < 1 || num > 9 || num > search_regexp.re_nsub) {
if (create)
*string++ = *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
* line or column number only if we hit Enter at the statusbar
* prompt. */
if (!parse_line_column(answer, &line, &column) || line < 1 ||
column < 1) {
if (!parse_line_column(answer, &line, &column) ||
line < 1 || column < 1) {
if (i == 0)
statusbar(_("Invalid line or column number"));
display_main_list();
@ -1133,8 +1129,7 @@ void do_find_bracket(void)
mbmatchhalf = mbstrlen(matchbrackets) / 2;
for (i = 0; i < mbmatchhalf; i++)
matchhalf += parse_mbchar(matchbrackets + matchhalf, NULL,
NULL);
matchhalf += parse_mbchar(matchbrackets + matchhalf, NULL, NULL);
reverse = ((ch - matchbrackets) >= matchhalf);