bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix quotearg when wchar.h is not used


From: Paolo Bonzini
Subject: [PATCH] fix quotearg when wchar.h is not used
Date: Mon, 02 Oct 2006 15:26:10 +0200
User-agent: Thunderbird 1.5.0.7 (Macintosh/20060909)

While testing GNU sed's bootstrap mode (where it handcrafts a minimal
config.h to work around system without a sed, or whose sed is not powerful enough to run configure), I found a bug in quotearg.c.

If HAVE_WCHAR_H and HAVE_MBRTOWC are not set, various functions are
#defined to work only on single-byte locales, but a mbstate_t variable
is defined around line 420.  Fixed with the attached trivial patch.

Paolo

2006-10-02  Paolo Bonzini  <address@hidden>  (tiny change)

        * lib/quotearg.c [!HAVE_MBRTOWC]: Define mbstate_t to int.

--- ../gnulib/lib/quotearg.c    2006-09-27 13:39:12.000000000 +0200
+++ ../lib/quotearg.c   2006-10-02 14:15:16.000000000 +0200
@@ -51,5 +51,7 @@
    syntax.  */
 # undef MB_CUR_MAX
+# undef mbstate_t
 # define MB_CUR_MAX 1
+# define mbstate_t int 
 # define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0)
 # define iswprint(wc) isprint ((unsigned char) (wc))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]