2004-03-24 Roland McGrath <roland@redhat.com>
authorroland <roland>
Thu, 25 Mar 2004 03:51:55 +0000 (03:51 +0000)
committerroland <roland>
Thu, 25 Mar 2004 03:51:55 +0000 (03:51 +0000)
* iconv/gconv_int.h (norm_add_slashes): Don't handle null SUFFIX.
strlen ("") gets optimized away just as well.
* intl/loadmsgcat.c (_nl_init_domain_conv): Update caller.
* wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Likewise.

iconv/gconv_int.h
intl/loadmsgcat.c
wcsmbs/wcsmbsload.c

index 782e16a..36d4ae2 100644 (file)
@@ -137,7 +137,7 @@ __libc_lock_define (extern, __gconv_lock);
     char *result;                                                            \
     char *tmp;                                                               \
     size_t cnt = 0;                                                          \
-    size_t suffix_len = (suffix) == NULL ? 0 : strlen (suffix);                      \
+    const size_t suffix_len = strlen (suffix);                               \
                                                                              \
     while (*cp != '\0')                                                              \
       if (*cp++ == '/')                                                              \
@@ -153,7 +153,7 @@ __libc_lock_define (extern, __gconv_lock);
        if (cnt < 1)                                                          \
          {                                                                   \
            *tmp++ = '/';                                                     \
-           if (suffix != NULL)                                               \
+           if (suffix_len != 0)                                              \
              tmp = __mempcpy (tmp, suffix, suffix_len);                      \
          }                                                                   \
       }                                                                              \
index d70d77e..a9c257c 100644 (file)
@@ -832,7 +832,7 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
 # ifdef _LIBC
          /* We always want to use transliteration.  */
          outcharset = norm_add_slashes (outcharset, "TRANSLIT");
-         charset = norm_add_slashes (charset, NULL);
+         charset = norm_add_slashes (charset, "");
          if (__gconv_open (outcharset, charset, &domain->conv,
                            GCONV_AVOID_NOCONV)
              != __GCONV_OK)
index 2fea6c3..e618895 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001,2002,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -179,7 +179,7 @@ __wcsmbs_load_conv (struct locale_data *new_category)
       /* Normalize the name and add the slashes necessary for a
         complete lookup.  */
       complete_name = norm_add_slashes (charset_name,
-                                       use_translit ? "TRANSLIT" : NULL);
+                                       use_translit ? "TRANSLIT" : "");
 
       /* It is not necessary to use transliteration in this direction
         since the internal character set is supposed to be able to