aboutsummaryrefslogtreecommitdiff
path: root/iconv/gconv_int.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-16 23:04:41 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-16 23:04:41 +0000
commit323fb88dac799cddfaa33cb80f7fc3395c2297e5 (patch)
treef853cfdf9b5bcde5a90324bb2115b225bb405ebd /iconv/gconv_int.h
parentf1d5c60ddef851078544e6b8456b18534b9a2a95 (diff)
downloadglibc-323fb88dac799cddfaa33cb80f7fc3395c2297e5.tar
glibc-323fb88dac799cddfaa33cb80f7fc3395c2297e5.tar.gz
glibc-323fb88dac799cddfaa33cb80f7fc3395c2297e5.tar.bz2
glibc-323fb88dac799cddfaa33cb80f7fc3395c2297e5.zip
Update.
2000-06-16 Ulrich Drepper <drepper@redhat.com> * iconv/gconv_int.h (norm_add_slashes): Optionally add given suffix. * iconv/gconv_open.c: Remove error handling specification from `from' character set name. * intl/loadmsgcat.c (_nl_load_domain): Call norm_add_slashes with new parameter to always enable transliteration. * locale/localeinfo.h (LIMAGIC): Bump number because of incompatible change. (struct locale_data): Add new members use_translit and options. * locale/findlocale.c (_nl_find_locale): Set use_translit flag is character set name contained modifier TRANSLIT. * locale/loadlocale.c (_nl_load_locale): Initialize new use_translit and options fields. (_nl_unload_locale): Free options string if necessary. * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Enable translation if the locale names suggested this. * locale/C-address.c: Add two new initialilzers to adjust data structure for new format. * locale/C-collate.c: Likewise. * locale/C-ctype.c: Likewise. * locale/C-identification.c: Likewise. * locale/C-measurement.c: Likewise. * locale/C-messages.c: Likewise. * locale/C-monetary.c: Likewise. * locale/C-name.c: Likewise. * locale/C-numeric.c: Likewise. * locale/C-paper.c: Likewise. * locale/C-telephone.c: Likewise. * locale/C-time.c: Likewise. * locale/setlocale.c: Add some more __builtin_expect.
Diffstat (limited to 'iconv/gconv_int.h')
-rw-r--r--iconv/gconv_int.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
index 34dff7d522..5bdf7143e6 100644
--- a/iconv/gconv_int.h
+++ b/iconv/gconv_int.h
@@ -102,18 +102,19 @@ extern struct gconv_module *__gconv_modules_db;
/* The gconv functions expects the name to be in upper case and complete,
including the trailing slashes if necessary. */
-#define norm_add_slashes(str) \
+#define norm_add_slashes(str,suffix) \
({ \
const char *cp = (str); \
char *result; \
char *tmp; \
size_t cnt = 0; \
+ size_t suffix_len = suffix == NULL ? 0 : strlen (suffix); \
\
while (*cp != '\0') \
if (*cp++ == '/') \
++cnt; \
\
- tmp = result = alloca (cp - (str) + 3); \
+ tmp = result = alloca (cp - (str) + 3 + suffix_len); \
cp = (str); \
while (*cp != '\0') \
*tmp++ = _toupper (*cp++); \
@@ -121,7 +122,11 @@ extern struct gconv_module *__gconv_modules_db;
{ \
*tmp++ = '/'; \
if (cnt < 1) \
- *tmp++ = '/'; \
+ { \
+ *tmp++ = '/'; \
+ if (suffix != NULL) \
+ tmp = __mempcpy (tmp, suffix, suffix_len); \
+ } \
} \
*tmp = '\0'; \
result; \