diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-19 12:38:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-19 12:38:34 +0100 |
commit | a3a9c8ef697bbf6f640cde99710b6f534f29f77d (patch) | |
tree | 358717fb6832b9e8a8bb5f9710e63e994741ba21 /src/ex_cmds.c | |
parent | 30d53e2c11e670845830bdfc29bf8c1615df61a8 (diff) | |
download | vim-git-a3a9c8ef697bbf6f640cde99710b6f534f29f77d.tar.gz |
patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite checkv8.2.0403
Problem: When 'buftype' is "nofile" there is no overwrite check.
Solution: Also check for existing file when 'buftype' is set.
(closes #5807)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index f92537862..ce5db8860 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2074,8 +2074,8 @@ check_overwrite( int other) // writing under other name { /* - * write to other file or b_flags set or not writing the whole file: - * overwriting only allowed with '!' + * Write to another file or b_flags set or not writing the whole file: + * overwriting only allowed with '!'. */ if ( (other || (buf->b_flags & BF_NOTEDITED) @@ -2083,9 +2083,6 @@ check_overwrite( && vim_strchr(p_cpo, CPO_OVERNEW) == NULL) || (buf->b_flags & BF_READERR)) && !p_wa -#ifdef FEAT_QUICKFIX - && !bt_nofilename(buf) -#endif && vim_fexists(ffname)) { if (!eap->forceit && !eap->append) |