(mbrtowc): Assign to *pwc, and return 1 only if result is nonzero.
authorJim Meyering <jim@meyering.net>
Tue, 4 Jul 2000 07:03:16 +0000 (07:03 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 4 Jul 2000 07:03:16 +0000 (07:03 +0000)
(iswprint): Use ISPRINT when substituting our own mbrtowc.

lib/quotearg.c

index 2483164..902192e 100644 (file)
 #  define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
 # endif
 #else
-# define mbrtowc(pwc, s, n, ps) 1
+# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0)
 # define mbsinit(ps) 1
+# define iswprint(wc) ISPRINT ((unsigned char) (wc))
 #endif
 
-#if HAVE_WCTYPE_H
-# include <wctype.h>
-#endif
-#if !defined iswprint && !HAVE_ISWPRINT
-# define iswprint(wc) 1
+#ifndef iswprint
+# if HAVE_WCTYPE_H
+#  include <wctype.h>
+# endif
+# if !defined iswprint && !HAVE_ISWPRINT
+#  define iswprint(wc) 1
+# endif
 #endif
 
 #define INT_BITS (sizeof (int) * CHAR_BIT)