Mercurial > vim
changeset 5322:9801d06e7b4c v7.4.014
updated for version 7.4.014
Problem: MS-Windows: check for writing to device does not work.
Solution: Fix #ifdefs. (Ken Takata)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 30 Aug 2013 17:07:01 +0200 |
parents | 4bc1b41f558c |
children | cfffb8ed42ca |
files | src/fileio.c src/version.c |
diffstat | 2 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -428,13 +428,13 @@ readfile(fname, sfname, from, lines_to_s } } + if (!read_stdin && !read_buffer) + { #ifdef UNIX - /* - * On Unix it is possible to read a directory, so we have to - * check for it before the mch_open(). - */ - if (!read_stdin && !read_buffer) - { + /* + * On Unix it is possible to read a directory, so we have to + * check for it before the mch_open(). + */ perm = mch_getperm(fname); if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */ # ifdef S_ISFIFO @@ -457,8 +457,8 @@ readfile(fname, sfname, from, lines_to_s msg_scroll = msg_save; return FAIL; } - -# if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#endif +#if defined(MSDOS) || defined(MSWIN) || defined(OS2) /* * MS-Windows allows opening a device, but we will probably get stuck * trying to read it. @@ -470,9 +470,8 @@ readfile(fname, sfname, from, lines_to_s msg_scroll = msg_save; return FAIL; } -# endif - } -#endif +#endif + } /* Set default or forced 'fileformat' and 'binary'. */ set_file_options(set_options, eap);