aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index dee9680230..70cdac7947 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -415,14 +415,10 @@ readfile (
msg_scroll = TRUE; /* don't overwrite previous file message */
/*
- * If the name ends in a path separator, we can't open it. Check here,
- * because reading the file may actually work, but then creating the swap
- * file may destroy it! Reported on MS-DOS and Win 95.
* If the name is too long we might crash further on, quit here.
*/
if (fname != NULL && *fname != NUL) {
- p = fname + STRLEN(fname);
- if (after_pathsep((char *)fname, (char *)p) || STRLEN(fname) >= MAXPATHL) {
+ if (STRLEN(fname) >= MAXPATHL) {
filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
msg_end();
msg_scroll = msg_save;
@@ -2627,7 +2623,7 @@ buf_write (
* Check if the file is really writable (when renaming the file to
* make a backup we won't discover it later).
*/
- file_readonly = os_file_is_readonly((char *)fname);
+ file_readonly = !os_file_is_writable((char *)fname);
if (!forceit && file_readonly) {
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL) {