summaryrefslogtreecommitdiff
path: root/src/filepath.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c40
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