From 5db915715f800d0858346bfbb5eea6aff4287ebd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 14 Aug 2001 23:29:55 +0000 Subject: Update. 2001-08-14 Jakub Jelinek * resolv/nss_dns/dns-host.c (RESOLVSORT): Define. (addrsort): New function. * resolv/gethnamaddr.c (RESOLVSORT): Define. 2001-08-14 Jakub Jelinek * string/strsignal.c (free_mem): Remove. 2001-08-14 Andreas Jaeger * inet/inet_ntoa.c (free_mem): Remove, it's not used anymore. Closes PR libc/2477, reported by Dylan Alex Simon . 2001-08-14 Ulrich Drepper * locale/Makefile (aux): Add xlocale. * locale/xlocale.c: New file. * include/locale.c (_nl_C_locobj): Declare. * iconv/gconv_charset.h: Use __tolower_l, __isdigit_l, __isspace_l with _nl_C_locobj instead of tolower, isdigit, isspace. * iconv/gconv_conf.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_open.c: Likewise. * locale/newlocale.c: Minor cleanups. --- iconv/gconv_charset.h | 8 +++++--- iconv/gconv_conf.c | 33 +++++++++++++++++---------------- iconv/gconv_int.h | 2 +- iconv/gconv_open.c | 12 +++++++----- 4 files changed, 30 insertions(+), 25 deletions(-) (limited to 'iconv') diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h index 278bccc8d5..76a92a15ab 100644 --- a/iconv/gconv_charset.h +++ b/iconv/gconv_charset.h @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include static inline void @@ -28,8 +29,9 @@ strip (char *wp, const char *s) while (*s != '\0') { - if (isalnum (*s) || *s == '_' || *s == '-' || *s == '.') - *wp++ = toupper (*s); + if (__isalnum_l (*s, &_nl_C_locobj) + || *s == '_' || *s == '-' || *s == '.') + *wp++ = __toupper_l (*s, &_nl_C_locobj); else if (*s == '/') { if (++slash_count == 3) @@ -50,7 +52,7 @@ static char * __attribute__ ((unused)) upstr (char *dst, const char *str) { char *cp = dst; - while ((*cp++ = toupper (*str++)) != '\0') + while ((*cp++ = __toupper_l (*str++, &_nl_C_locobj)) != '\0') /* nothing */; return dst; } diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index db5bb476fd..99519d09d2 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -129,20 +130,20 @@ add_alias (char *rp, void *modules) struct gconv_alias *new_alias; char *from, *to, *wp; - while (isspace (*rp)) + while (__isspace_l (*rp, &_nl_C_locobj)) ++rp; from = wp = rp; - while (*rp != '\0' && !isspace (*rp)) - *wp++ = toupper (*rp++); + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) + *wp++ = __toupper_l (*rp++, &_nl_C_locobj); if (*rp == '\0') /* There is no `to' string on the line. Ignore it. */ return; *wp++ = '\0'; to = ++rp; - while (isspace (*rp)) + while (__isspace_l (*rp, &_nl_C_locobj)) ++rp; - while (*rp != '\0' && !isspace (*rp)) - *wp++ = toupper (*rp++); + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) + *wp++ = __toupper_l (*rp++, &_nl_C_locobj); if (to == wp) /* No `to' string, ignore the line. */ return; @@ -250,30 +251,30 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules, int need_ext; int cost_hi; - while (isspace (*rp)) + while (__isspace_l (*rp, &_nl_C_locobj)) ++rp; from = rp; - while (*rp != '\0' && !isspace (*rp)) + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) { - *rp = toupper (*rp); + *rp = __toupper_l (*rp, &_nl_C_locobj); ++rp; } if (*rp == '\0') return; *rp++ = '\0'; to = wp = rp; - while (isspace (*rp)) + while (__isspace_l (*rp, &_nl_C_locobj)) ++rp; - while (*rp != '\0' && !isspace (*rp)) - *wp++ = toupper (*rp++); + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) + *wp++ = __toupper_l (*rp++, &_nl_C_locobj); if (*rp == '\0') return; *wp++ = '\0'; do ++rp; - while (isspace (*rp)); + while (__isspace_l (*rp, &_nl_C_locobj)); module = wp; - while (*rp != '\0' && !isspace (*rp)) + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) *wp++ = *rp++; if (*rp == '\0') { @@ -386,7 +387,7 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len, if (rp[n - 1] == '\n') rp[n - 1] = '\0'; - while (isspace (*rp)) + while (__isspace_l (*rp, &_nl_C_locobj)) ++rp; /* If this is an empty line go on with the next one. */ @@ -394,7 +395,7 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len, continue; word = rp; - while (*rp != '\0' && !isspace (*rp)) + while (*rp != '\0' && !__isspace_l (*rp, &_nl_C_locobj)) ++rp; if (rp - word == sizeof ("alias") - 1 diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h index 3b5f195b04..d9edcb079f 100644 --- a/iconv/gconv_int.h +++ b/iconv/gconv_int.h @@ -141,7 +141,7 @@ extern const char *__gconv_path_envvar; tmp = result = alloca (cp - (str) + 3 + suffix_len); \ cp = (str); \ while (*cp != '\0') \ - *tmp++ = _toupper (*cp++); \ + *tmp++ = __toupper_l (*cp++, &_nl_C_locobj); \ if (cnt < 2) \ { \ *tmp++ = '/'; \ diff --git a/iconv/gconv_open.c b/iconv/gconv_open.c index 0bf343d1b2..dfcd7b772f 100644 --- a/iconv/gconv_open.c +++ b/iconv/gconv_open.c @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include #include #include @@ -64,7 +65,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle, tok = __strtok_r (tok, ",", &ptr); while (tok != NULL) { - if (__strcasecmp (tok, "TRANSLIT") == 0) + if (__strcasecmp_l (tok, "TRANSLIT", &_nl_C_locobj) == 0) { /* It's the builtin transliteration handling. We only support it for working on the internal encoding. */ @@ -97,7 +98,7 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle, lastp->next = newp; } } - else if (__strcasecmp (tok, "IGNORE") == 0) + else if (__strcasecmp_l (tok, "IGNORE", &_nl_C_locobj) == 0) /* Set the flag to ignore all errors. */ conv_flags |= __GCONV_IGNORE_ERRORS; else @@ -110,7 +111,8 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle, for (runp = trans; runp != NULL; runp = runp->next) if (runp->name != NULL - && __strcasecmp (tok, runp->name) == 0) + && __strcasecmp_l (tok, runp->name, + &_nl_C_locobj) == 0) break; else lastp = runp; @@ -205,8 +207,8 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle, modules for this step. */ for (runp = trans; runp != NULL; runp = runp->next) for (n = 0; n < runp->ncsnames; ++n) - if (__strcasecmp (steps[cnt].__from_name, - runp->csnames[n]) == 0) + if (__strcasecmp_l (steps[cnt].__from_name, + runp->csnames[n], &_nl_C_locobj) == 0) { void *data = NULL; -- cgit 1.4.1