aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorDaniel Xu <danobi@users.noreply.github.com>2016-07-05 22:40:25 -0700
committerJustin M. Keyes <justinkz@gmail.com>2016-07-06 01:40:25 -0400
commit5f1a153831d480180b2203120cff776d771ec1a4 (patch)
tree09fc7791734a1e3ed5a72c6e8195707db7e2ece4 /src/nvim/ex_cmds.c
parentbd6dad06dd1f4182cc65c41575af8bf1e3ea22a9 (diff)
downloadrneovim-5f1a153831d480180b2203120cff776d771ec1a4.tar.gz
rneovim-5f1a153831d480180b2203120cff776d771ec1a4.tar.bz2
rneovim-5f1a153831d480180b2203120cff776d771ec1a4.zip
os/fs: Rename os_file_exists to os_path_exists (#4973)
Because the old name did not indicate that the function would return true on directories as well.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c20
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];