updated for version 7.0015
diff --git a/src/fileio.c b/src/fileio.c
index 026bc8f..b82cd4a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -370,15 +370,21 @@
* 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 @@
/* execute the autocommands for this buffer */
retval = do_doautocmd(eap->arg, FALSE);
- do_modelines();
+ do_modelines(FALSE);
/* restore the current window */
aucmd_restbuf(&aco);