diff src/ex_docmd.c @ 2168:99b00399c7b4 vim73

updated for version 7.2.435 Problem: Crash when using bad_char_idx uninitialized. (Patrick Texier) Solution: Don't use bad_char_idx, reproduce the ++bad argument from bad_char.
author Bram Moolenaar <bram@vim.org>
date Sun, 16 May 2010 13:26:25 +0200
parents 99b225e0dbc1
children f60a0c9cbe6c
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4688,6 +4688,7 @@ getargopt(eap)
     char_u	*arg = eap->arg + 2;
     int		*pp = NULL;
 #ifdef FEAT_MBYTE
+    int		bad_char_idx;
     char_u	*p;
 #endif
 
@@ -4739,7 +4740,7 @@ getargopt(eap)
     else if (STRNCMP(arg, "bad", 3) == 0)
     {
 	arg += 3;
-	pp = &eap->bad_char_idx;
+	pp = &bad_char_idx;
     }
 #endif
 
@@ -4770,7 +4771,7 @@ getargopt(eap)
     {
 	/* Check ++bad= argument.  Must be a single-byte character, "keep" or
 	 * "drop". */
-	p = eap->cmd + eap->bad_char_idx;
+	p = eap->cmd + bad_char_idx;
 	if (STRICMP(p, "keep") == 0)
 	    eap->bad_char = BAD_KEEP;
 	else if (STRICMP(p, "drop") == 0)