diff options
author | erw7 <erw7.github@gmail.com> | 2020-10-06 10:31:50 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2020-10-06 10:31:50 +0900 |
commit | c043e806a5fbe4f23a5f9de38a1ac82ab6d05bf4 (patch) | |
tree | 8f9353e8a50b322542b8462f1461e0a47dbb3c2d /src | |
parent | f8a5b4bdce489f4df7df15d0b363b608853b92d6 (diff) | |
download | rneovim-c043e806a5fbe4f23a5f9de38a1ac82ab6d05bf4.tar.gz rneovim-c043e806a5fbe4f23a5f9de38a1ac82ab6d05bf4.tar.bz2 rneovim-c043e806a5fbe4f23a5f9de38a1ac82ab6d05bf4.zip |
fileio: fix "is a directory" warning on Windows
The porting of vim/vim@c8fe645 by #13040 on Windows was incomplete.
This fixes that and makes the "is a directory" warning appear properly
on Windows as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/fileio.c | 12 | ||||
-rw-r--r-- | src/nvim/testdir/test_edit.vim | 2 |
2 files changed, 0 insertions, 14 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 521d5c9deb..1b4a89fb6c 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -470,7 +470,6 @@ readfile( if (!read_buffer && !read_stdin && !read_fifo) { perm = os_getperm((const char *)fname); -#ifdef UNIX // On Unix it is possible to read a directory, so we have to // check for it before os_open(). if (perm >= 0 && !S_ISREG(perm) // not a regular file ... @@ -494,7 +493,6 @@ readfile( msg_scroll = msg_save; return S_ISDIR(perm) ? NOTDONE : FAIL; } -#endif } /* Set default or forced 'fileformat' and 'binary'. */ @@ -553,13 +551,6 @@ readfile( if (fd < 0) { // cannot open at all msg_scroll = msg_save; -#ifndef UNIX - // On non-unix systems we can't open a directory, check here. - if (os_isdir(fname)) { - filemess(curbuf, sfname, (char_u *)_(msg_is_a_directory), 0); - curbuf->b_p_ro = true; // must use "w!" now - } else { -#endif if (!newfile) { return FAIL; } @@ -617,9 +608,6 @@ readfile( return FAIL; } -#ifndef UNIX - } -#endif /* * Only set the 'ro' flag for readonly files the first time they are diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 97a8ad25a3..d4b1c63741 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1536,10 +1536,8 @@ func Test_edit_noesckeys() endfunc " Test for editing a directory -" Todo: "is a directory" message is not displayed in Windows. func Test_edit_is_a_directory() CheckEnglish - CheckNotMSWindows let dirname = getcwd() . "/Xdir" call mkdir(dirname, 'p') |