With recent changes in gnulib, we're due for
a little adaptation here:

>From 77921019ae8b7b4e072805033f98f5bc8cfb466e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@redhat.com>
Date: Tue, 23 Dec 2008 19:06:31 +0100
Subject: [PATCH 1/2] cleanup/modernize: don't test HAVE_MBRTOWC, now that 
gnulib provides it

* 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 |    5 ++++-
 src/ls.c       |    4 ----
 src/wc.c       |    4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 2fa7f0d..b7306ac 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -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
+       mbswidth
+       mbrtowc
+       memcasecmp mempcpy
        memrchr mgetgroups
        mkancesdirs mkdir mkdir-p mkstemp mktime modechange
        mountlist mpsort obstack pathmax perl physmem
diff --git a/src/ls.c b/src/ls.c
index 0081865..b03aebc 100644
--- 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;
diff --git a/src/wc.c b/src/wc.c
index 65368f9..b1afe14 100644
--- 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)
     {
--
1.6.1.302.gccd4d


>From f5b1c600c4e4be1c5a759e460d6cd406013cbf99 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@redhat.com>
Date: Tue, 23 Dec 2008 20:00:27 +0100
Subject: [PATCH 2/2] portability: accommodate gnulib's getaddrinfo change

* src/Makefile.am (pinky_LDADD, who_LDADD): Append $(GETADDRINFO_LIB)
---
 src/Makefile.am |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 819b874..555700b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -169,6 +169,10 @@ split_LDADD += $(LIBICONV)
 timeout_LDADD += $(LIBICONV)
 truncate_LDADD += $(LIBICONV)

+# programs that use getaddrinfo (e.g., via canon_host)
+pinky_LDADD = $(LDADD) $(GETADDRINFO_LIB)
+who_LDADD = $(LDADD) $(GETADDRINFO_LIB)
+
 $(PROGRAMS): ../lib/libcoreutils.a

 # Get the release year from ../lib/version-etc.c.
--
1.6.1.302.gccd4d


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to