diff options
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 86f1a16216..d0661b6b9b 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1745,14 +1745,14 @@ check_overwrite ( * write to other file or b_flags set or not writing the whole file: * overwriting only allowed with '!' */ - if ( (other - || (buf->b_flags & BF_NOTEDITED) - || ((buf->b_flags & BF_NEW) - && vim_strchr(p_cpo, CPO_OVERNEW) == NULL) - || (buf->b_flags & BF_READERR)) - && !p_wa - && !bt_nofile(buf) - && os_file_exists(ffname)) { + if ((other + || (buf->b_flags & BF_NOTEDITED) + || ((buf->b_flags & BF_NEW) + && vim_strchr(p_cpo, CPO_OVERNEW) == NULL) + || (buf->b_flags & BF_READERR)) + && !p_wa + && !bt_nofile(buf) + && os_path_exists(ffname)) { if (!eap->forceit && !eap->append) { #ifdef UNIX // It is possible to open a directory on Unix. @@ -1795,7 +1795,7 @@ check_overwrite ( } swapname = makeswapname(fname, ffname, curbuf, dir); xfree(dir); - if (os_file_exists(swapname)) { + if (os_path_exists(swapname)) { if (p_confirm || cmdmod.confirm) { char_u buff[DIALOG_MSG_SIZE]; @@ -1909,7 +1909,7 @@ static int check_readonly(int *forceit, buf_T *buf) /* Handle a file being readonly when the 'readonly' option is set or when * the file exists and permissions are read-only. */ if (!*forceit && (buf->b_p_ro - || (os_file_exists(buf->b_ffname) + || (os_path_exists(buf->b_ffname) && !os_file_is_writable((char *)buf->b_ffname)))) { if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL) { char_u buff[DIALOG_MSG_SIZE]; |