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.
This commit is contained in:
@@ -462,7 +462,8 @@ bool open_buffer(const char *filename, bool new_buffer)
|
|||||||
/* When not overriding an existing lock, discard the buffer. */
|
/* When not overriding an existing lock, discard the buffer. */
|
||||||
if (do_lockfile(realname) < 0) {
|
if (do_lockfile(realname) < 0) {
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
close_buffer();
|
if (openfile != openfile->next)
|
||||||
|
close_buffer();
|
||||||
#endif
|
#endif
|
||||||
free(realname);
|
free(realname);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user