updated for version 7.0013
diff --git a/src/eval.c b/src/eval.c
index 78513a2..4e6c7b6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -8065,6 +8065,7 @@
 # endif
 	++winnr;
     }
+    ga_append(&ga, NUL);
 
     retvar->var_val.var_string = ga.ga_data;
 #else
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 3a49b9a..ba36700 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2203,6 +2203,7 @@
 	    buf_T	*was_curbuf = curbuf;
 
 	    apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
+	    apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, alt_buf);
 # ifdef FEAT_EVAL
 	    if (curbuf != was_curbuf || aborting())
 # else
@@ -2231,6 +2232,7 @@
 	    buf_name_changed(curbuf);
 #ifdef FEAT_AUTOCMD
 	    apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
+	    apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, alt_buf);
 	    if (!alt_buf->b_p_bl)
 	    {
 		alt_buf->b_p_bl = TRUE;
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 921d608..1386115 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -1193,9 +1193,9 @@
 }
 
 /*
- * Throw the current exception through the specified cstack.  Common routine for
- * ":throw" (user exception) and error and interrupt exceptions.  Also used for
- * rethrowing an uncaught exception.
+ * Throw the current exception through the specified cstack.  Common routine
+ * for ":throw" (user exception) and error and interrupt exceptions.  Also
+ * used for rethrowing an uncaught exception.
  */
     void
 do_throw(cstack)
@@ -1210,8 +1210,8 @@
      * conditional itself, so that its ACTIVE flag can be tested below.  But
      * if a previous error or interrupt has not been converted to an exception,
      * inactivate the try conditional, too, as if the conversion had been done,
-     * and reset the did_emsg or got_int flag, so this won't happen again at the
-     * next surrounding try conditional.
+     * and reset the did_emsg or got_int flag, so this won't happen again at
+     * the next surrounding try conditional.
      */
     if (did_emsg && !THROW_ON_ERROR)
     {
@@ -1228,16 +1228,16 @@
     {
 	/*
 	 * If this try conditional is active and we are before its first
-	 * ":catch", set THROWN so that the ":catch" commands will check whether
-	 * the exception matches.  When the exception came from any of the
-	 * catch clauses, it will be made pending at the ":finally" (if present)
-	 * and rethrown at the ":endtry".  This will also happen if the try
-	 * conditional is inactive.  This is the case when we are throwing an
-	 * exception due to an error or interrupt on the way from a preceding
-	 * ":continue", ":break", ":return", ":finish", error or interrupt (not
-	 * converted to an exception) to the finally clause or from a preceding
-	 * throw of a user or error or interrupt exception to the matching catch
-	 * clause or the finally clause.
+	 * ":catch", set THROWN so that the ":catch" commands will check
+	 * whether the exception matches.  When the exception came from any of
+	 * the catch clauses, it will be made pending at the ":finally" (if
+	 * present) and rethrown at the ":endtry".  This will also happen if
+	 * the try conditional is inactive.  This is the case when we are
+	 * throwing an exception due to an error or interrupt on the way from
+	 * a preceding ":continue", ":break", ":return", ":finish", error or
+	 * interrupt (not converted to an exception) to the finally clause or
+	 * from a preceding throw of a user or error or interrupt exception to
+	 * the matching catch clause or the finally clause.
 	 */
 	if (!(cstack->cs_flags[idx] & CSF_CAUGHT))
 	{
@@ -1253,8 +1253,8 @@
 	cstack->cs_exception[idx] = current_exception;
     }
 #if 0
-    /* TODO: Add optimization below.  Not yet done because of interface problems
-     * to eval.c and ex_cmds2.c. (Servatius) */
+    /* TODO: Add optimization below.  Not yet done because of interface
+     * problems to eval.c and ex_cmds2.c. (Servatius) */
     else
     {
 	/*
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 7d1e2825..a541f04 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -5476,6 +5476,7 @@
 	ga_append(&ga, '\n');
 	vim_free(theline);
     }
+    ga_append(&ga, NUL);
 
     return (char_u *)ga.ga_data;
 }
diff --git a/src/gui.c b/src/gui.c
index c8930d8..9b33f9d 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4586,12 +4586,14 @@
 	ga_concat(&ga, (char_u *)"/");
 	concat_esc(&ga, repl_text, '/');	/* escape slashes */
 	ga_concat(&ga, (char_u *)"/g");
+	ga_append(&ga, NUL);
 	do_cmdline_cmd(ga.ga_data);
     }
     else
     {
 	/* Search for the next match. */
 	i = msg_scroll;
+	ga_append(&ga, NUL);
 	do_search(NULL, down ? '/' : '?', ga.ga_data, 1L,
 						    SEARCH_MSG + SEARCH_MARK);
 	msg_scroll = i;	    /* don't let an error message set msg_scroll */
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c
index a82139e..fb5999a 100644
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -683,6 +683,7 @@
     }
     if (regProp != empty_prop)
 	XFree(regProp);
+    ga_append(&ga, NUL);
     return ga.ga_data;
 }
 
@@ -1258,7 +1259,7 @@
 		    ga_append(&reply, 0);
 		    ga_concat(&reply, (char_u *)"-c 1");
 		}
-		ga_append(&reply, 0);
+		ga_append(&reply, NUL);
 		(void)AppendPropCarefully(dpy, resWindow, commProperty,
 					   reply.ga_data, reply.ga_len);
 	    }
@@ -1363,7 +1364,7 @@
 	    if ((r = ServerReplyFind(win, SROP_Add)) != NULL)
 	    {
 		ga_concat(&(r->strings), str);
-		ga_append(&(r->strings), 0);
+		ga_append(&(r->strings), NUL);
 	    }
 #ifdef FEAT_AUTOCMD
 	    sprintf((char *)winstr, "0x%x", (unsigned int)win);
diff --git a/src/macros.h b/src/macros.h
index 6506aee..43bddba 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -159,7 +159,6 @@
 #  define mch_fopen(n, p)	fopen((n), (p))
 # endif
 # define mch_fstat(n, p)	fstat((n), (p))
-# define mch_lstat(n, p)	lstat((n), (p))
 # ifdef MSWIN	/* has it's own mch_stat() function */
 #  define mch_stat(n, p)	vim_stat((n), (p))
 # else
@@ -173,6 +172,12 @@
 # endif
 #endif
 
+#ifdef HAVE_LSTAT
+# define mch_lstat(n, p)	lstat((n), (p))
+#else
+# define mch_lstat(n, p)	mch_stat((n), (p))
+#endif
+
 #ifdef MACOS_CLASSIC
 /* MacOS classic doesn't support perm but MacOS X does. */
 # define mch_open(n, m, p)	open((n), (m))
diff --git a/src/option.c b/src/option.c
index bcf4183..981e231 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5312,11 +5312,13 @@
 
 #ifdef FEAT_PRINTER
     else if (varp == &p_popt)
-	errmsg = parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS);
+	errmsg = parse_list_options(p_popt, printer_opts,
+						       OPT_PRINT_NUM_OPTIONS);
 
 # if defined(FEAT_MBYTE) && defined(FEAT_POSTSCRIPT)
     else if (varp == &p_pmfn)
-	errmsg = parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS);
+	errmsg = parse_list_options(p_pmfn, mbfont_opts,
+						      OPT_MBFONT_NUM_OPTIONS);
 # endif
 #endif
 
diff --git a/src/os_mswin.c b/src/os_mswin.c
index d199f3e..3ce61bc 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2689,6 +2689,7 @@
     ga_init2(&ga, 1, 100);
 
     EnumWindows(enumWindowsGetNames, (LPARAM)(&ga));
+    ga_append(&ga, NUL);
 
     return ga.ga_data;
 }