locking: remove any lock files when dying
This fixes https://savannah.gnu.org/bugs/?48675.
Этот коммит содержится в:
родитель
faa46a3c71
Коммит
a7ae1766c0
10
src/nano.c
10
src/nano.c
@ -603,6 +603,12 @@ void die(const char *msg, ...)
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* If the current buffer has a lockfile, remove it. */
|
||||
if (ISSET(LOCKING) && openfile->lock_filename)
|
||||
delete_lockfile(openfile->lock_filename);
|
||||
#endif
|
||||
|
||||
/* Save the current file buffer if it's been modified. */
|
||||
if (openfile && openfile->modified) {
|
||||
/* If we've partitioned the filestruct, unpartition it now. */
|
||||
@ -624,6 +630,10 @@ void die(const char *msg, ...)
|
||||
while (tmp != openfile->next) {
|
||||
openfile = openfile->next;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(LOCKING) && openfile->lock_filename)
|
||||
delete_lockfile(openfile->lock_filename);
|
||||
#endif
|
||||
/* Save the current file buffer if it's been modified. */
|
||||
if (openfile->modified)
|
||||
die_save_file(openfile->filename
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user