changeset 2144:2775dcd05603 v7.2.426

updated for version 7.2.426 Problem: Commas in 'langmap' are not always handled correctly. Solution: Require commas to be backslash escaped. (James Vega)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 17:32:58 +0200
parents 79d111ea8ef6
children de0e7ca61893
files src/option.c src/version.c
diffstat 2 files changed, 27 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -10432,6 +10432,11 @@ langmap_set()
 	    p2 = NULL;	    /* aAbBcCdD form, p2 is NULL */
 	while (p[0])
 	{
+	    if (p[0] == ',')
+	    {
+		++p;
+		break;
+	    }
 	    if (p[0] == '\\' && p[1] != NUL)
 		++p;
 #ifdef FEAT_MBYTE
@@ -10439,26 +10444,33 @@ langmap_set()
 #else
 	    from = p[0];
 #endif
+	    to = NUL;
 	    if (p2 == NULL)
 	    {
 		mb_ptr_adv(p);
-		if (p[0] == '\\')
-		    ++p;
+		if (p[0] != ',')
+		{
+		    if (p[0] == '\\')
+			++p;
 #ifdef FEAT_MBYTE
-		to = (*mb_ptr2char)(p);
-#else
-		to = p[0];
-#endif
+		    to = (*mb_ptr2char)(p);
+#else
+		    to = p[0];
+#endif
+		}
 	    }
 	    else
 	    {
-		if (p2[0] == '\\')
-		    ++p2;
+		if (p2[0] != ',')
+		{
+		    if (p2[0] == '\\')
+			++p2;
 #ifdef FEAT_MBYTE
-		to = (*mb_ptr2char)(p2);
-#else
-		to = p2[0];
-#endif
+		    to = (*mb_ptr2char)(p2);
+#else
+		    to = p2[0];
+#endif
+		}
 	    }
 	    if (to == NUL)
 	    {
@@ -10476,15 +10488,7 @@ langmap_set()
 
 	    /* Advance to next pair */
 	    mb_ptr_adv(p);
-	    if (p2 == NULL)
-	    {
-		if (p[0] == ',')
-		{
-		    ++p;
-		    break;
-		}
-	    }
-	    else
+	    if (p2 != NULL)
 	    {
 		mb_ptr_adv(p2);
 		if (*p == ';')
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    426,
+/**/
     425,
 /**/
     424,