diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-02 17:36:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-02 17:36:31 +0100 |
commit | 022f9ef16c955d6b5fca0f53b79899c56a3966c5 (patch) | |
tree | 8528160f0a3d3d24887d3d548951deb07f71a0d9 /src/filepath.c | |
parent | 2d2950198231a31bf87c1cd4322099cc36b0bb93 (diff) | |
download | vim-git-022f9ef16c955d6b5fca0f53b79899c56a3966c5.tar.gz |
patch 9.0.0028: MS-Windows: tests fail if there is a "runtime" directoryv9.0.0028
Problem: MS-Windows: tests fail if there is a stray "runtime" directory.
Solution: Only use a "runtime" directory if it contains "defaults.vim".
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/filepath.c b/src/filepath.c index 854d823c9..f1ae18e0b 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -774,6 +774,26 @@ shorten_dir(char_u *str) shorten_dir_len(str, 1); } +/* + * Return TRUE if "fname" is a readable file. + */ + int +file_is_readable(char_u *fname) +{ + int fd; + +#ifndef O_NONBLOCK +# define O_NONBLOCK 0 +#endif + if (*fname && !mch_isdir(fname) + && (fd = mch_open((char *)fname, O_RDONLY | O_NONBLOCK, 0)) >= 0) + { + close(fd); + return TRUE; + } + return FALSE; +} + #if defined(FEAT_EVAL) || defined(PROTO) /* @@ -894,26 +914,6 @@ f_exepath(typval_T *argvars, typval_T *rettv) } /* - * Return TRUE if "fname" is a readable file. - */ - int -file_is_readable(char_u *fname) -{ - int fd; - -#ifndef O_NONBLOCK -# define O_NONBLOCK 0 -#endif - if (*fname && !mch_isdir(fname) - && (fd = mch_open((char *)fname, O_RDONLY | O_NONBLOCK, 0)) >= 0) - { - close(fd); - return TRUE; - } - return FALSE; -} - -/* * "filereadable()" function */ void |