nano

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

commit 5cedb53c629869319e4adcd8bfba329fad955c3e
parent 650dc14e0fae06e3b314f66eb16e951368fbb332
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 12 Sep 2021 09:54:31 +0200

files: write a lock file also for a freshly saved buffer

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

Bug existed since version 2.3.2, since --locking was introduced,
and continued to exist since version 4.8 despite commit 497f126b
claiming to have fixed it.

Diffstat:
Msrc/files.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -1978,8 +1978,10 @@ bool write_file(const char *name, FILE *thefile, bool tmp, if (openfile->lock_filename != NULL) { delete_lockfile(openfile->lock_filename); free(openfile->lock_filename); - openfile->lock_filename = do_lockfile(realname, FALSE); } + + if (ISSET(LOCKING)) + openfile->lock_filename = do_lockfile(realname, FALSE); #endif openfile->filename = mallocstrcpy(openfile->filename, realname); #ifdef ENABLE_COLOR