aboutsummaryrefslogtreecommitdiff
path: root/locale/programs
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/ld-ctype.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 8839a9e8f8..e899649d65 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -788,6 +788,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
+ ctype->map_collection_nr];
struct locale_file data;
uint32_t idx[nelems + 1];
+ uint32_t default_missing_len;
size_t elem, cnt, offset, total;
char *cp;
@@ -814,8 +815,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
case _NL_ITEM_INDEX (name): \
iov[2 + elem + offset].iov_base = (base); \
iov[2 + elem + offset].iov_len = (len); \
- if (elem + 1 < nelems) \
- idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; \
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; \
break
CTYPE_DATA (_NL_CTYPE_CLASS,
@@ -1007,6 +1007,26 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
break;
+ case _NL_ITEM_INDEX(_NL_CTYPE_TRANSLIT_DEFAULT_MISSING):
+ iov[2 + elem + offset].iov_base =
+ ctype->default_missing ?: (uint32_t *) L"";
+ iov[2 + elem + offset].iov_len =
+ wcslen (iov[2 + elem + offset].iov_base);
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
+ break;
+
+ case _NL_ITEM_INDEX(_NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN):
+ default_missing_len = (ctype->default_missing
+ ? wcslen ((wchar_t *)ctype->default_missing)
+ : 1);
+ iov[2 + elem + offset].iov_base = &default_missing_len;
+ iov[2 + elem + offset].iov_len = sizeof (uint32_t);
+ /* Remove the following line in case a new entry is added
+ after _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN. */
+ if (elem < nelems)
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
+ break;
+
default:
assert (! "unknown CTYPE element");
}