diff src/fileio.c @ 216:da182deebec7

updated for version 7.0061
author vimboss
date Fri, 18 Mar 2005 20:25:31 +0000
parents 3b32f6b507fa
children 4707450c2b33
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3701,7 +3701,7 @@ buf_write(buf, fname, sfname, start, end
     while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
 			? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
 			: (O_CREAT | O_TRUNC))
-			, perm & 0777)) < 0)
+			, perm < 0 ? 0666 : (perm & 0777))) < 0)
     {
 	/*
 	 * A forced write will try to create a new file if the old one is
@@ -4269,7 +4269,7 @@ restore_backup:
 
 	    if (org == NULL
 		    || (empty_fd = mch_open(org, O_CREAT | O_EXTRA | O_EXCL,
-							    perm & 0777)) < 0)
+					perm < 0 ? 0666 : (perm & 0777))) < 0)
 	      EMSG(_("E206: patchmode: can't touch empty original file"));
 	    else
 	      close(empty_fd);