aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-09 07:52:58 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-09 07:52:58 +0000
commitf1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382 (patch)
treeddaa6228b210d05b84bf417434a3327ba5dc10a4 /locale
parentaf1680f1f9926a0662fc35a53c491d2eec1ab262 (diff)
downloadglibc-f1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382.zip
glibc-f1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382.tar.gz
glibc-f1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382.tar.bz2
Update.
* locale/programs/ld-ctype.c (ctype_output): Correct sizes of mapping arrays. (allocate_arrays): Allocate memory for map32. Correctly install default values in it and install defined mappings. * locale/programs/ld-monetary.c (monetary_finish): Provide default value for mon_grouping.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-ctype.c29
-rw-r--r--locale/programs/ld-monetary.c12
2 files changed, 26 insertions, 15 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 1b8775e..5dcb013 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -787,20 +787,18 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
CTYPE_DATA (_NL_CTYPE_TOUPPER,
ctype->map[0],
- (ctype->plane_size * ctype->plane_cnt + 128)
- * sizeof (uint32_t));
+ (256 + 128) * sizeof (uint32_t));
CTYPE_DATA (_NL_CTYPE_TOLOWER,
ctype->map[1],
- (ctype->plane_size * ctype->plane_cnt + 128)
- * sizeof (uint32_t));
+ (256 + 128) * sizeof (uint32_t));
CTYPE_DATA (_NL_CTYPE_TOUPPER32,
ctype->map32[0],
- (ctype->plane_size * ctype->plane_cnt + 128)
+ (ctype->plane_size * ctype->plane_cnt)
* sizeof (uint32_t));
CTYPE_DATA (_NL_CTYPE_TOLOWER32,
ctype->map32[1],
- (ctype->plane_size * ctype->plane_cnt + 128)
+ (ctype->plane_size * ctype->plane_cnt)
* sizeof (uint32_t));
CTYPE_DATA (_NL_CTYPE_CLASS32,
@@ -981,7 +979,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + elem + offset].iov_base = ctype->map32[nr];
iov[2 + elem + offset].iov_len = ((ctype->plane_size
- * ctype->plane_cnt + 128)
+ * ctype->plane_cnt)
* sizeof (uint32_t));
idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
@@ -3059,18 +3057,25 @@ Computing table size for character classes might take a while..."),
unsigned int idx2;
/* Allocate table. */
- ctype->map[idx] = (uint32_t *) xmalloc (ctype->plane_size
- * ctype->plane_cnt
- * sizeof (uint32_t));
+ ctype->map32[idx] = (uint32_t *) xmalloc (ctype->plane_size
+ * ctype->plane_cnt
+ * sizeof (uint32_t));
/* Copy default value (identity mapping). */
- memcpy (ctype->map[idx], ctype->names,
+ memcpy (ctype->map32[idx], ctype->names,
ctype->plane_size * ctype->plane_cnt * sizeof (uint32_t));
/* Copy values from collection. */
for (idx2 = 0; idx2 < 256; ++idx2)
if (ctype->map_collection[idx][idx2] != 0)
- ctype->map[idx][idx2] = ctype->map_collection[idx][idx2];
+ ctype->map32[idx][idx2] = ctype->map_collection[idx][idx2];
+
+ while (idx2 < ctype->map_collection_act[idx])
+ if (ctype->map_collection[idx][idx2] != 0)
+ *find_idx (ctype, &ctype->map32[idx],
+ &ctype->map_collection_max[idx],
+ &ctype->map_collection_act[idx],
+ ctype->names[idx2]) = ctype->map_collection[idx][idx2];
}
/* Extra array for class and map names. */
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index 31846b1..afad481 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -241,9 +241,15 @@ not correspond to a valid name in ISO 4217"),
"LC_MONETARY", "mon_decimal_point");
}
- if (monetary->mon_grouping_len == 0 && ! be_quiet && ! nothing)
- error (0, 0, _("%s: field `%s' not defined"),
- "LC_MONETARY", "mon_grouping");
+ if (monetary->mon_grouping_len == 0)
+ {
+ if (! be_quiet && ! nothing)
+ error (0, 0, _("%s: field `%s' not defined"),
+ "LC_MONETARY", "mon_grouping");
+
+ monetary->mon_grouping = "\177";
+ monetary->mon_grouping_len = 1;
+ }
#undef TEST_ELEM
#define TEST_ELEM(cat, min, max) \