From: Benno Schulenberg Date: Tue, 23 Feb 2016 08:31:57 +0000 (+0000) Subject: Renaming a variable, for contrast and correctness. X-Git-Tag: v2.5.3~10 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8a2dd978f873bfb10e96441062247b9c639dc4dc;p=nano.git Renaming a variable, for contrast and correctness. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5670 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 4377c815..31f62a7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-02-23 Benno Schulenberg + * src/prompt.c (do_statusbar_output, do_statusbar_delete): + Rename a variable, for contrast and correctness. + 2016-02-22 Chris Allegretta * Add ability to kill the trailing spaces when justifying code. New nanorc option kill_spaces_on_justify, we'll see diff --git a/src/prompt.c b/src/prompt.c index 8aa6c534..dc3f614a 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -248,7 +248,7 @@ void do_statusbar_output(int *the_input, size_t input_len, { char *output = charalloc(input_len + 1); char *char_buf = charalloc(mb_cur_max()); - int i, char_buf_len; + int i, char_len; assert(answer != NULL); @@ -274,23 +274,23 @@ void do_statusbar_output(int *the_input, size_t input_len, } /* Interpret the next multibyte character. */ - char_buf_len = parse_mbchar(output + i, char_buf, NULL); + char_len = parse_mbchar(output + i, char_buf, NULL); - i += char_buf_len; + i += char_len; /* When filtering, skip any ASCII control character. */ - if (filtering && is_ascii_cntrl_char(*(output + i - char_buf_len))) + if (filtering && is_ascii_cntrl_char(*(output + i - char_len))) continue; assert(statusbar_x <= strlen(answer)); /* Insert the typed character into the existing answer string. */ - answer = charealloc(answer, strlen(answer) + char_buf_len + 1); - charmove(answer + statusbar_x + char_buf_len, answer + statusbar_x, + answer = charealloc(answer, strlen(answer) + char_len + 1); + charmove(answer + statusbar_x + char_len, answer + statusbar_x, strlen(answer) - statusbar_x + 1); - strncpy(answer + statusbar_x, char_buf, char_buf_len); + strncpy(answer + statusbar_x, char_buf, char_len); - statusbar_x += char_buf_len; + statusbar_x += char_len; } free(char_buf); @@ -348,12 +348,12 @@ void do_statusbar_delete(void) statusbar_pww = statusbar_xplustabs(); if (answer[statusbar_x] != '\0') { - int char_buf_len = parse_mbchar(answer + statusbar_x, NULL, NULL); + int char_len = parse_mbchar(answer + statusbar_x, NULL, NULL); assert(statusbar_x < strlen(answer)); - charmove(answer + statusbar_x, answer + statusbar_x + char_buf_len, - strlen(answer) - statusbar_x - char_buf_len + 1); + charmove(answer + statusbar_x, answer + statusbar_x + char_len, + strlen(answer) - statusbar_x - char_len + 1); align(&answer); update_the_statusbar();