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.
This commit is contained in:
Daniel Xu
2016-07-05 22:40:25 -07:00
committed by Justin M. Keyes
parent bd6dad06dd
commit 5f1a153831
16 changed files with 93 additions and 73 deletions

View File

@@ -684,7 +684,7 @@ static size_t do_path_expand(garray_T *gap, const char_u *path,
}
// add existing file or symbolic link
if ((flags & EW_ALLLINKS) ? os_fileinfo_link((char *)buf, &file_info)
: os_file_exists(buf)) {
: os_path_exists(buf)) {
addfile(gap, buf, flags);
}
}
@@ -1205,10 +1205,11 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file,
/* When EW_NOTFOUND is used, always add files and dirs. Makes
* "vim c:/" work. */
if (flags & EW_NOTFOUND)
if (flags & EW_NOTFOUND) {
addfile(&ga, t, flags | EW_DIR | EW_FILE);
else if (os_file_exists(t))
} else if (os_path_exists(t)) {
addfile(&ga, t, flags);
}
xfree(t);
}
@@ -1327,7 +1328,7 @@ void addfile(
if (!(flags & EW_NOTFOUND)
&& ((flags & EW_ALLLINKS)
? !os_fileinfo_link((char *)f, &file_info)
: !os_file_exists(f))) {
: !os_path_exists(f))) {
return;
}