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