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.
master
parent
650dc14e0f
commit
5cedb53c62
|
@ -1978,8 +1978,10 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
|
||||||
if (openfile->lock_filename != NULL) {
|
if (openfile->lock_filename != NULL) {
|
||||||
delete_lockfile(openfile->lock_filename);
|
delete_lockfile(openfile->lock_filename);
|
||||||
free(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
|
#endif
|
||||||
openfile->filename = mallocstrcpy(openfile->filename, realname);
|
openfile->filename = mallocstrcpy(openfile->filename, realname);
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
|
|
Loading…
Reference in New Issue