nano

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

commit 9b90ec877a0479c44abc08873791e29f507e26d2
parent 8b483c10baca5ff6dd4a0e43ad85a0f737465365
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun, 18 Dec 2016 17:56:18 +0100

tweaks: drive closer to the edge

Diffstat:
Msrc/files.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -2962,12 +2962,11 @@ void load_history(void) size_t buf_len = 0; ssize_t read; - while ((read = getline(&line, &buf_len, hist)) >= 0) { - if (read > 0 && line[read - 1] == '\n') - line[--read] = '\0'; - if (read > 0) { + while ((read = getline(&line, &buf_len, hist)) > 0) { + line[--read] = '\0'; + if (read > 0) update_history(history, line); - } else + else history = &replace_history; }