summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-09-06 17:44:46 +0000
committerBram Moolenaar <Bram@vim.org>2004-09-06 17:44:46 +0000
commit15d0a8c77dad867b69822e2fd8f9f6bbcf765c48 (patch)
treee84faedc007f9c2b81b9056a400dccade2b947e5 /src/fileio.c
parentd4755bb0e04fca334675f1503bd6474b017a9bba (diff)
updated for version 7.0015v7.0015
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 026bc8f384..b82cd4a6e7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -370,15 +370,21 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
* 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
- && (vim_ispathsep(*(fname + STRLEN(fname) - 1))
- || STRLEN(fname) >= MAXPATHL))
+ if (fname != NULL && *fname != NUL)
{
- filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
- msg_end();
- msg_scroll = msg_save;
- return FAIL;
+ p = fname + STRLEN(fname) - 1;
+ if ((vim_ispathsep(*p)
+#ifdef FEAT_MBYTE
+ /* Do not use a multi-byte char as path separator. */
+ && (!has_mbyte || (*mb_head_off)(fname, p) == 0)
+#endif
+ ) || STRLEN(fname) >= MAXPATHL)
+ {
+ filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
+ msg_end();
+ msg_scroll = msg_save;
+ return FAIL;
+ }
}
#ifdef UNIX
@@ -7526,7 +7532,7 @@ ex_doautoall(eap)
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap->arg, FALSE);
- do_modelines();
+ do_modelines(FALSE);
/* restore the current window */
aucmd_restbuf(&aco);