nano

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

commit a1132c81a1f5322f6f7e6ef06b5c0b212dd29ab7
parent 0496aed4aba12fefa520616a527996b4dfcf5179
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 20 Mar 2018 10:31:03 +0100

files: prevent the undo of reading a file into a new buffer

When the file has just been read, it is in the state that it has
on disk, so there is nothing to undo.

This fixes https://savannah.gnu.org/bugs/?53387.

Diffstat:
Msrc/files.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -483,7 +483,7 @@ bool open_buffer(const char *filename, bool undoable) /* If we have a non-new file, read it in. Then, if the buffer has * no stat, update the stat, if applicable. */ if (rc > 0) { - read_file(f, rc, realname, undoable, new_buffer); + read_file(f, rc, realname, undoable && !new_buffer, new_buffer); #ifndef NANO_TINY if (openfile->current_stat == NULL) stat_with_alloc(realname, &openfile->current_stat);