summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
committerBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
commitc236c16d0884c7d6cdc4dbaddb8cb3992085f83e (patch)
tree7d87344cdf07b6b9234abe26ccef39fbbee54f63 /src/eval.c
parentb316376b4893ac3ae62f7f33c483b28b7fc147c0 (diff)
downloadvim-git-c236c16d0884c7d6cdc4dbaddb8cb3992085f83e.tar.gz
updated for version 7.2b-000v7.2b.000
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c
index 7ebaa08f1..18c8329df 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -10,7 +10,7 @@
/*
* eval.c: Expression evaluation.
*/
-#if defined(MSDOS) || defined(MSWIN)
+#if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64)
# include "vimio.h" /* for mch_open(), must be before vim.h */
#endif
@@ -9697,15 +9697,19 @@ f_filereadable(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
- FILE *fd;
+ int fd;
char_u *p;
int n;
+#ifndef O_NONBLOCK
+# define O_NONBLOCK 0
+#endif
p = get_tv_string(&argvars[0]);
- if (*p && !mch_isdir(p) && (fd = mch_fopen((char *)p, "r")) != NULL)
+ if (*p && !mch_isdir(p) && (fd = mch_open((char *)p,
+ O_RDONLY | O_NONBLOCK, 0)) >= 0)
{
n = TRUE;
- fclose(fd);
+ close(fd);
}
else
n = FALSE;
@@ -21975,7 +21979,7 @@ shortpath_for_invalid_fname(fname, bufp, fnamelen)
ch = *endp;
*endp = 0;
short_fname = save_fname;
- len = STRLEN(short_fname) + 1;
+ len = (int)STRLEN(short_fname) + 1;
if (get_short_pathname(&short_fname, &pbuf_unused, &len) == FAIL)
{
retval = FAIL;