]> git.sur5r.net Git - openldap/commitdiff
ITS#8508 - Allow ucgendat.c to recognize title-case characters even if they do not...
authorZebediah Figura <z.figura12@gmail.com>
Sat, 1 Oct 2016 02:26:59 +0000 (21:26 -0500)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 11 Oct 2017 21:32:16 +0000 (14:32 -0700)
I, Zebediah Figura, hereby place the following modifications to OpenLDAP Software (and only these modifications) into the public domain. Hence, these modifications may be freely used and/or redistributed for any purpose with or without attribution and/or other notice.

libraries/liblunicode/ucdata/ucgendat.c
libraries/liblunicode/ucdata/uctable.h

index 7a3b991c0447b4f3c9bc9ced3acd8affc3817522..da3ca86286d9d3577510a8ea7a33c353c29b4032 100644 (file)
@@ -536,6 +536,13 @@ add_title(ac_uint4 code)
      */
     cases[2] = code;
 
+    /*
+     * If the upper case character is not present, then make it the same as
+     * the title case.
+     */
+    if (cases[0] == 0)
+      cases[0] = code;
+
     if (title_used == title_size) {
         if (title_size == 0)
           title = (_case_t *) malloc(sizeof(_case_t) << 3);
@@ -818,7 +825,7 @@ read_cdata(FILE *in)
 {
     ac_uint4 i, lineno, skip, code, ccl_code;
     short wnum, neg, number[2], compat;
-    char line[512], *s, *e;
+    char line[512], *s, *e, *first_prop;
 
     lineno = skip = 0;
     while (fgets(line, sizeof(line), in)) {
@@ -962,6 +969,8 @@ read_cdata(FILE *in)
               i++;
         }
         for (e = s; *e && *e != ';'; e++) ;
+
+        first_prop = s;
     
         ordered_range_insert(code, s, e - s);
 
@@ -1109,7 +1118,7 @@ read_cdata(FILE *in)
             if (*s == ';')
               s++;
         }
-        if (cases[0] && cases[1])
+        if (!strncmp(first_prop,"Lt",2) && (cases[0] || cases[1]))
           /*
            * Add the upper and lower mappings for a title case character.
            */
index 6aef2322f23d9614cfbc584c13ca8900ddfd8f6c..f6c06e9c84bb2299d9b5be314b52700fe66cf659 100644 (file)
@@ -1495,7 +1495,7 @@ static const ac_uint4 _ucprop_ranges[] = {
 
 static const ac_uint4 _uccase_size = 1504;
 
-static const ac_uint2 _uccase_len[2] = {745, 755};
+static const ac_uint2 _uccase_len[2] = {718, 755};
 
 static const ac_uint4 _uccase_map[] = {
        0x00000041, 0x00000061, 0x00000041,
@@ -2086,40 +2086,14 @@ static const ac_uint4 _uccase_map[] = {
        0x00001f6d, 0x00001f65, 0x00001f6d,
        0x00001f6e, 0x00001f66, 0x00001f6e,
        0x00001f6f, 0x00001f67, 0x00001f6f,
-       0x00001f88, 0x00001f80, 0x00001f88,
-       0x00001f89, 0x00001f81, 0x00001f89,
-       0x00001f8a, 0x00001f82, 0x00001f8a,
-       0x00001f8b, 0x00001f83, 0x00001f8b,
-       0x00001f8c, 0x00001f84, 0x00001f8c,
-       0x00001f8d, 0x00001f85, 0x00001f8d,
-       0x00001f8e, 0x00001f86, 0x00001f8e,
-       0x00001f8f, 0x00001f87, 0x00001f8f,
-       0x00001f98, 0x00001f90, 0x00001f98,
-       0x00001f99, 0x00001f91, 0x00001f99,
-       0x00001f9a, 0x00001f92, 0x00001f9a,
-       0x00001f9b, 0x00001f93, 0x00001f9b,
-       0x00001f9c, 0x00001f94, 0x00001f9c,
-       0x00001f9d, 0x00001f95, 0x00001f9d,
-       0x00001f9e, 0x00001f96, 0x00001f9e,
-       0x00001f9f, 0x00001f97, 0x00001f9f,
-       0x00001fa8, 0x00001fa0, 0x00001fa8,
-       0x00001fa9, 0x00001fa1, 0x00001fa9,
-       0x00001faa, 0x00001fa2, 0x00001faa,
-       0x00001fab, 0x00001fa3, 0x00001fab,
-       0x00001fac, 0x00001fa4, 0x00001fac,
-       0x00001fad, 0x00001fa5, 0x00001fad,
-       0x00001fae, 0x00001fa6, 0x00001fae,
-       0x00001faf, 0x00001fa7, 0x00001faf,
        0x00001fb8, 0x00001fb0, 0x00001fb8,
        0x00001fb9, 0x00001fb1, 0x00001fb9,
        0x00001fba, 0x00001f70, 0x00001fba,
        0x00001fbb, 0x00001f71, 0x00001fbb,
-       0x00001fbc, 0x00001fb3, 0x00001fbc,
        0x00001fc8, 0x00001f72, 0x00001fc8,
        0x00001fc9, 0x00001f73, 0x00001fc9,
        0x00001fca, 0x00001f74, 0x00001fca,
        0x00001fcb, 0x00001f75, 0x00001fcb,
-       0x00001fcc, 0x00001fc3, 0x00001fcc,
        0x00001fd8, 0x00001fd0, 0x00001fd8,
        0x00001fd9, 0x00001fd1, 0x00001fd9,
        0x00001fda, 0x00001f76, 0x00001fda,
@@ -2133,7 +2107,6 @@ static const ac_uint4 _uccase_map[] = {
        0x00001ff9, 0x00001f79, 0x00001ff9,
        0x00001ffa, 0x00001f7c, 0x00001ffa,
        0x00001ffb, 0x00001f7d, 0x00001ffb,
-       0x00001ffc, 0x00001ff3, 0x00001ffc,
        0x00002126, 0x000003c9, 0x00002126,
        0x0000212a, 0x0000006b, 0x0000212a,
        0x0000212b, 0x000000e5, 0x0000212b,
@@ -3001,7 +2974,34 @@ static const ac_uint4 _uccase_map[] = {
        0x000001c5, 0x000001c4, 0x000001c6,
        0x000001c8, 0x000001c7, 0x000001c9,
        0x000001cb, 0x000001ca, 0x000001cc,
-       0x000001f2, 0x000001f1, 0x000001f3
+       0x000001f2, 0x000001f1, 0x000001f3,
+       0x00001f88, 0x00001f88, 0x00001f80,
+       0x00001f89, 0x00001f89, 0x00001f81,
+       0x00001f8a, 0x00001f8a, 0x00001f82,
+       0x00001f8b, 0x00001f8b, 0x00001f83,
+       0x00001f8c, 0x00001f8c, 0x00001f84,
+       0x00001f8d, 0x00001f8d, 0x00001f85,
+       0x00001f8e, 0x00001f8e, 0x00001f86,
+       0x00001f8f, 0x00001f8f, 0x00001f87,
+       0x00001f98, 0x00001f98, 0x00001f90,
+       0x00001f99, 0x00001f99, 0x00001f91,
+       0x00001f9a, 0x00001f9a, 0x00001f92,
+       0x00001f9b, 0x00001f9b, 0x00001f93,
+       0x00001f9c, 0x00001f9c, 0x00001f94,
+       0x00001f9d, 0x00001f9d, 0x00001f95,
+       0x00001f9e, 0x00001f9e, 0x00001f96,
+       0x00001f9f, 0x00001f9f, 0x00001f97,
+       0x00001fa8, 0x00001fa8, 0x00001fa0,
+       0x00001fa9, 0x00001fa9, 0x00001fa1,
+       0x00001faa, 0x00001faa, 0x00001fa2,
+       0x00001fab, 0x00001fab, 0x00001fa3,
+       0x00001fac, 0x00001fac, 0x00001fa4,
+       0x00001fad, 0x00001fad, 0x00001fa5,
+       0x00001fae, 0x00001fae, 0x00001fa6,
+       0x00001faf, 0x00001faf, 0x00001fa7,
+       0x00001fbc, 0x00001fbc, 0x00001fb3,
+       0x00001fcc, 0x00001fcc, 0x00001fc3,
+       0x00001ffc, 0x00001ffc, 0x00001ff3
 };
 
 static const ac_uint4 _uccomp_size = 3684;