diff options
-rw-r--r-- | src/nvim/ex_cmds2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 898c3fb3f9..b7f4f269e1 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -203,7 +203,6 @@ void dialog_changed(buf_T *buf, bool checkall) .append = false, .forceit = false, }; - bool empty_buf = buf->b_fname == NULL; dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname); if (checkall) { @@ -213,7 +212,8 @@ void dialog_changed(buf_T *buf, bool checkall) } if (ret == VIM_YES) { - if (empty_buf) { + bool empty_bufname = buf->b_fname == NULL; + if (empty_bufname) { buf_set_name(buf->b_fnum, "Untitled"); } @@ -225,7 +225,7 @@ void dialog_changed(buf_T *buf, bool checkall) } // restore to empty when write failed - if (empty_buf) { + if (empty_bufname) { XFREE_CLEAR(buf->b_fname); XFREE_CLEAR(buf->b_ffname); XFREE_CLEAR(buf->b_sfname); |