commit bc9862fbffbc171fdce390e7671d56e5e0b521c0
parent 582a624998e73bcdb4edcdcdb3ca33f9f88f5b65
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 29 Mar 2017 21:35:56 +0200
tweaks: condense some declarations by reshuffling
Diffstat:
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1812,16 +1812,13 @@ int do_mouse(void)
* TRUE. */
void do_output(char *output, size_t output_len, bool allow_cntrls)
{
- size_t current_len, i = 0;
-#ifndef NANO_TINY
- size_t orig_rows = 0, original_row = 0;
-#endif
char *char_buf = charalloc(mb_cur_max());
int char_len;
-
- current_len = strlen(openfile->current->data);
-
+ size_t current_len = strlen(openfile->current->data);
+ size_t i = 0;
#ifndef NANO_TINY
+ size_t orig_rows = 0, original_row = 0;
+
if (ISSET(SOFTWRAP)) {
if (openfile->current_y == editwinrows - 1)
original_row = xplustabs() / editwincols;
@@ -1850,8 +1847,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
refresh_needed = TRUE;
}
- assert(openfile->current_x <= current_len);
-
/* Make room for the new character and copy it into the line. */
openfile->current->data = charealloc(openfile->current->data,
current_len + char_len + 1);