nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 90cf4838d2bf1724e033df8eed95088837f9b37d
parent 4c7ec18a550ecd6f38e285dcaecf469dfac87fae
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 15 Jan 2018 19:46:16 +0100

tweaks: don't bother to reallocate when the keybuffer size decreases

It will be reallocated soon enough when the size increases again.

Diffstat:
Msrc/winio.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -316,12 +316,9 @@ int *get_input(WINDOW *win, size_t input_len) key_buffer_len -= input_len; /* If the buffer still contains keystrokes, move them to the front. */ - if (key_buffer_len > 0) { + if (key_buffer_len > 0) memmove(key_buffer, key_buffer + input_len, key_buffer_len * sizeof(int)); - key_buffer = (int *)nrealloc(key_buffer, key_buffer_len * - sizeof(int)); - } return input; }