summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-14 18:56:38 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-14 18:56:38 +0200
commit2efbc66e260a9988b5d66c68de940bff6fcdb954 (patch)
tree8fc48dc072e5ec53e76a6619568214928b5df8b1 /src/fileio.c
parentf9ddb94283148020cab6ce74cbbdda59ab53e4ac (diff)
downloadvim-2efbc66e260a9988b5d66c68de940bff6fcdb954.zip
updated for version 7.2.429
Problem: A file that exists but access is denied may result in a "new file" message. E.g. when its directory is unreadable. Solution: Specifically check for ENOENT to decide a file doesn't exist. (partly by James Vega)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 88188e597..c36796972 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -595,7 +595,11 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#endif
if (newfile)
{
- if (perm < 0)
+ if (perm < 0
+#ifdef ENOENT
+ && errno == ENOENT
+#endif
+ )
{
/*
* Set the 'new-file' flag, so that when the file has
@@ -664,6 +668,9 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
# ifdef EFBIG
(errno == EFBIG) ? _("[File too big]") :
# endif
+# ifdef EOVERFLOW
+ (errno == EOVERFLOW) ? _("[File too big]") :
+# endif
_("[Permission Denied]")), 0);
curbuf->b_p_ro = TRUE; /* must use "w!" now */
}