diff src/fileio.c @ 2147:2bd29808d1f6 v7.2.429

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)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 18:56:38 +0200
parents 8aa3cd045aef
children f60a0c9cbe6c
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -595,7 +595,11 @@ readfile(fname, sfname, from, lines_to_s
 #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_s
 # 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 */
 		}