Blame SOURCES/7.4.014

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.014
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.014
22c937
Problem:    MS-Windows: check for writing to device does not work.
22c937
Solution:   Fix #ifdefs. (Ken Takata)
22c937
Files:	    src/fileio.c
22c937
22c937
22c937
*** ../vim-7.4.013/src/fileio.c	2013-08-25 17:46:05.000000000 +0200
22c937
--- src/fileio.c	2013-08-30 16:56:46.000000000 +0200
22c937
***************
22c937
*** 428,440 ****
22c937
  	}
22c937
      }
22c937
  
22c937
- #ifdef UNIX
22c937
-     /*
22c937
-      * On Unix it is possible to read a directory, so we have to
22c937
-      * check for it before the mch_open().
22c937
-      */
22c937
      if (!read_stdin && !read_buffer)
22c937
      {
22c937
  	perm = mch_getperm(fname);
22c937
  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
22c937
  # ifdef S_ISFIFO
22c937
--- 428,440 ----
22c937
  	}
22c937
      }
22c937
  
22c937
      if (!read_stdin && !read_buffer)
22c937
      {
22c937
+ #ifdef UNIX
22c937
+ 	/*
22c937
+ 	 * On Unix it is possible to read a directory, so we have to
22c937
+ 	 * check for it before the mch_open().
22c937
+ 	 */
22c937
  	perm = mch_getperm(fname);
22c937
  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
22c937
  # ifdef S_ISFIFO
22c937
***************
22c937
*** 457,464 ****
22c937
  	    msg_scroll = msg_save;
22c937
  	    return FAIL;
22c937
  	}
22c937
! 
22c937
! # if defined(MSDOS) || defined(MSWIN) || defined(OS2)
22c937
  	/*
22c937
  	 * MS-Windows allows opening a device, but we will probably get stuck
22c937
  	 * trying to read it.
22c937
--- 457,464 ----
22c937
  	    msg_scroll = msg_save;
22c937
  	    return FAIL;
22c937
  	}
22c937
! #endif
22c937
! #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
22c937
  	/*
22c937
  	 * MS-Windows allows opening a device, but we will probably get stuck
22c937
  	 * trying to read it.
22c937
***************
22c937
*** 470,478 ****
22c937
  	    msg_scroll = msg_save;
22c937
  	    return FAIL;
22c937
  	}
22c937
- # endif
22c937
-     }
22c937
  #endif
22c937
  
22c937
      /* Set default or forced 'fileformat' and 'binary'. */
22c937
      set_file_options(set_options, eap);
22c937
--- 470,477 ----
22c937
  	    msg_scroll = msg_save;
22c937
  	    return FAIL;
22c937
  	}
22c937
  #endif
22c937
+     }
22c937
  
22c937
      /* Set default or forced 'fileformat' and 'binary'. */
22c937
      set_file_options(set_options, eap);
22c937
*** ../vim-7.4.013/src/version.c	2013-08-30 16:51:15.000000000 +0200
22c937
--- src/version.c	2013-08-30 16:54:33.000000000 +0200
22c937
***************
22c937
*** 740,741 ****
22c937
--- 740,743 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     14,
22c937
  /**/
22c937
22c937
-- 
22c937
Drink wet cement and get really stoned.
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///