aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-28 23:00:28 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-28 23:00:28 +0000
commit5295113f8f7da48eedbcdbf1c375a42b7d90a9f5 (patch)
tree6459119b72951e4b763f7a30ae1ed2e39c1440f2 /locale
parentf1f1b6b95a3d2dee0d69eeb0ab606d3c3c0a4b5e (diff)
downloadglibc-5295113f8f7da48eedbcdbf1c375a42b7d90a9f5.zip
glibc-5295113f8f7da48eedbcdbf1c375a42b7d90a9f5.tar.gz
glibc-5295113f8f7da48eedbcdbf1c375a42b7d90a9f5.tar.bz2
Update.
* locale/programs/ld-collate.c (insert_weights): Handle <Uxxxx> symbols in multi-character weights correctly.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-collate.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 73a186d..97059c2 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -724,8 +724,10 @@ insert_weights (struct linereader *ldfile, struct element_t *elem,
{
if (*cp == '<')
{
- /* Ahh, it's a bsymbol. That's what we want. */
+ /* Ahh, it's a bsymbol or an UCS4 value. If it's
+ the latter we have to unify the name. */
const char *startp = ++cp;
+ size_t len;
while (*cp != '>')
{
@@ -738,9 +740,24 @@ insert_weights (struct linereader *ldfile, struct element_t *elem,
++cp;
}
- charelem = find_element (ldfile, collate, startp,
- cp - startp);
- ++cp;
+ if (cp - startp == 5 && startp[0] == 'U'
+ && isxdigit (startp[1]) && isxdigit (startp[2])
+ && isxdigit (startp[3]) && isxdigit (startp[4]))
+ {
+ unsigned int ucs4 = strtoul (startp + 1, NULL, 16);
+ char *newstr;
+
+ newstr = (char *) xmalloc (10);
+ snprintf (newstr, 10, "U%08X", ucs4);
+ startp = newstr;
+
+ len = 9;
+ }
+ else
+ len = cp - startp;
+
+ charelem = find_element (ldfile, collate, startp, len);
+ ++cp;
}
else
{