diff src/fileio.c @ 23:3f44e9abe4ec v7.0015

updated for version 7.0015
author vimboss
date Mon, 06 Sep 2004 17:44:46 +0000
parents cc049b00ee70
children 8ff7fd162d3c
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -370,15 +370,21 @@ readfile(fname, sfname, from, lines_to_s
      * 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))
-    {
-	filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
-	msg_end();
-	msg_scroll = msg_save;
-	return FAIL;
+    if (fname != NULL && *fname != NUL)
+    {
+	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);