]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0715: Not correctly parsing color names (after v9.1.0709) v9.1.0715
authorChristian Brabandt <cb@256bit.org>
Wed, 4 Sep 2024 20:10:34 +0000 (22:10 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 4 Sep 2024 20:10:34 +0000 (22:10 +0200)
Problem:  Not correctly parsing color names (chdiza, after v9.1.0709)
Solution: Revert part of the patch that compares the color names and
          fall-back to the macro STRICMP

fixes: #15617
closes: #15619

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/highlight.c
src/misc2.c
src/proto/misc2.pro
src/version.c

index 0928952fd12af3c363bbc6f7f486d9db8bc8e526..d3ea2d20168592d07fc2e5a6631541cf59c1a873 100644 (file)
@@ -1215,8 +1215,8 @@ highlight_set_cterm_color(
 
        target.key = 0;
        target.value = (char *)arg;
-       target.length = 0;      // not used, see cmp_keyvalue_value_ni()
-       entry = (keyvalue_T *)bsearch(&target, &color_name_tab, ARRAY_LENGTH(color_name_tab), sizeof(color_name_tab[0]), cmp_keyvalue_value_ni);
+       target.length = 0;      // not used, see cmp_keyvalue_value_i()
+       entry = (keyvalue_T *)bsearch(&target, &color_name_tab, ARRAY_LENGTH(color_name_tab), sizeof(color_name_tab[0]), cmp_keyvalue_value_i);
        if (entry == NULL)
        {
            semsg(_(e_color_name_or_number_not_recognized_str), key_start);
@@ -2542,8 +2542,8 @@ gui_get_color_cmn(char_u *name)
 
     target.key = 0;
     target.value = (char *)name;
-    target.length = 0;         // not used, see cmp_keyvalue_value_ni()
-    entry = (keyvalue_T *)bsearch(&target, &rgb_tab, ARRAY_LENGTH(rgb_tab), sizeof(rgb_tab[0]), cmp_keyvalue_value_ni);
+    target.length = 0;         // not used, see cmp_keyvalue_value_i()
+    entry = (keyvalue_T *)bsearch(&target, &rgb_tab, ARRAY_LENGTH(rgb_tab), sizeof(rgb_tab[0]), cmp_keyvalue_value_i);
     if (entry != NULL)
        return gui_adjust_rgb((guicolor_T)entry->key);
 
index 5a8f369c1948ba1ee3fd21dd44f027d0b010aa54..31feebfe497cd8fee7f2fa02039f8774af504c4e 100644 (file)
@@ -3090,6 +3090,16 @@ cmp_keyvalue_value_n(const void *a, const void *b)
     return STRNCMP(kv1->value, kv2->value, MAX(kv1->length, kv2->length));
 }
 
+// compare two keyvalue_T structs by case insensitive value
+    int
+cmp_keyvalue_value_i(const void *a, const void *b)
+{
+    keyvalue_T *kv1 = (keyvalue_T *)a;
+    keyvalue_T *kv2 = (keyvalue_T *)b;
+
+    return STRICMP(kv1->value, kv2->value);
+}
+
 // compare two keyvalue_T structs by case insensitive ASCII value
 // with length
     int
index dbcfc084b0e3089567ec2c2c5c8068c5edacc9a6..7a5b36736d805ca88e3c199546fae42ccf6eff21 100644 (file)
@@ -63,5 +63,6 @@ int build_argv_from_list(list_T *l, char ***argv, int *argc);
 int get_special_pty_type(void);
 int cmp_keyvalue_value(const void *a, const void *b);
 int cmp_keyvalue_value_n(const void *a, const void *b);
+int cmp_keyvalue_value_i(const void *a, const void *b);
 int cmp_keyvalue_value_ni(const void *a, const void *b);
 /* vim: set ft=c : */
index b35a89e2e37747cead0cdd7575912e0b0486d8bb..536c1fb03dfc199bfaa72b564503eff9f17a2715 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    715,
 /**/
     714,
 /**/