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