cleanup/modernize: don't test HAVE_MBRTOWC; now gnulib provides it
authorJim Meyering <meyering@redhat.com>
Tue, 23 Dec 2008 18:06:31 +0000 (19:06 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 1 Jan 2009 01:15:07 +0000 (02:15 +0100)
* bootstrap.conf (gnulib_modules): Include mbrtowc explicitly.
* src/ls.c (quote_name): Don't test HAVE_MBRTOWC, now that we're
guaranteed to have the function.
* src/wc.c (wc): Likewise.

bootstrap.conf
src/ls.c
src/wc.c

index 2fa7f0d..203a80c 100644 (file)
@@ -66,7 +66,10 @@ gnulib_modules="
        ignore-value
        inttostr inttypes isapipe
        lchmod lchown lib-ignore linebuffer link-follow
-       long-options lstat malloc mbswidth memcasecmp mempcpy
+       long-options lstat malloc
+       mbrtowc
+       mbswidth
+       memcasecmp mempcpy
        memrchr mgetgroups
        mkancesdirs mkdir mkdir-p mkstemp mktime modechange
        mountlist mpsort obstack pathmax perl physmem
index 0081865..b03aebc 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -3681,7 +3681,6 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options,
 
   if (qmark_funny_chars)
     {
-#if HAVE_MBRTOWC
       if (MB_CUR_MAX > 1)
        {
          char const *p = buf;
@@ -3784,7 +3783,6 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options,
          len = q - buf;
        }
       else
-#endif
        {
          char *p = buf;
          char const *plimit = buf + len;
@@ -3800,11 +3798,9 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options,
     }
   else if (width != NULL)
     {
-#if HAVE_MBRTOWC
       if (MB_CUR_MAX > 1)
        displayed_width = mbsnwidth (buf, len, 0);
       else
-#endif
        {
          char const *p = buf;
          char const *plimit = buf + len;
index 65368f9..b1afe14 100644 (file)
--- a/src/wc.c
+++ b/src/wc.c
@@ -196,7 +196,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
 
   /* If in the current locale, chars are equivalent to bytes, we prefer
      counting bytes, because that's easier.  */
-#if HAVE_MBRTOWC && (MB_LEN_MAX > 1)
+#if MB_LEN_MAX > 1
   if (MB_CUR_MAX > 1)
     {
       count_bytes = print_bytes;
@@ -272,7 +272,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
          bytes += bytes_read;
        }
     }
-#if HAVE_MBRTOWC && (MB_LEN_MAX > 1)
+#if MB_LEN_MAX > 1
 # define SUPPORT_OLD_MBRTOWC 1
   else if (MB_CUR_MAX > 1)
     {