# HG changeset patch # User Christian Brabandt # Date 1712340903 -7200 # Node ID e27831e54542a39b4c6367cd1ffec106f853951d # Parent e75d871c5b91d06ea4d72377259402a0d8a6aba1 patch 9.1.0267: File name entered in GUI dialog is ignored Commit: https://github.com/vim/vim/commit/c20bdf1107d48a1c14713709d12d429e761132af Author: zeertzjq Date: Fri Apr 5 20:02:55 2024 +0200 patch 9.1.0267: File name entered in GUI dialog is ignored Problem: File name entered in GUI dialog is ignored (after v9.1.0265) Solution: Only set file name to "Untitled" if GUI dialog didn't set it. (zeertzjq) closes: #14417 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -164,7 +164,6 @@ dialog_changed( int ret; buf_T *buf2; exarg_T ea; - int empty_buf = buf->b_fname == NULL ? TRUE : FALSE; dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname); if (checkall) @@ -178,11 +177,14 @@ dialog_changed( if (ret == VIM_YES) { + int empty_bufname; + #ifdef FEAT_BROWSE // May get file name, when there is none browse_save_fname(buf); #endif - if (empty_buf) + empty_bufname = buf->b_fname == NULL ? TRUE : FALSE; + if (empty_bufname) buf_set_name(buf->b_fnum, (char_u *)"Untitled"); if (check_overwrite(&ea, buf, buf->b_fname, buf->b_ffname, FALSE) == OK) @@ -193,14 +195,11 @@ dialog_changed( } // restore to empty when write failed - if (empty_buf) + if (empty_bufname) { - vim_free(buf->b_fname); - buf->b_fname = NULL; - vim_free(buf->b_ffname); - buf->b_ffname = NULL; - vim_free(buf->b_sfname); - buf->b_sfname = NULL; + VIM_CLEAR(buf->b_fname); + VIM_CLEAR(buf->b_ffname); + VIM_CLEAR(buf->b_sfname); unchanged(buf, TRUE, FALSE); } } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 267, +/**/ 266, /**/ 265,