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