files: don't close a newly-created buffer when it is the only one
This fixes https://savannah.gnu.org/bugs/?56504.
Reported-by: Liu Hao <lh_mouse@126.com>
Bug existed since commit 7e422402
from two weeks ago.
master
parent
c7ca60b046
commit
345cf5accc
|
@ -462,7 +462,8 @@ bool open_buffer(const char *filename, bool new_buffer)
|
|||
/* When not overriding an existing lock, discard the buffer. */
|
||||
if (do_lockfile(realname) < 0) {
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
close_buffer();
|
||||
if (openfile != openfile->next)
|
||||
close_buffer();
|
||||
#endif
|
||||
free(realname);
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue