summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-07-04 07:03:16 +0000
committerJim Meyering <jim@meyering.net>2000-07-04 07:03:16 +0000
commit5a6fe4fd57739de534fd9e994a673e79a145eede (patch)
tree95236b0c934c4165544ac1098a791ba89dd16e63 /lib
parent8d765a5946816638cc4dd4fbf5aa7dd219f0ba00 (diff)
downloadcoreutils-5a6fe4fd57739de534fd9e994a673e79a145eede.tar.xz
(mbrtowc): Assign to *pwc, and return 1 only if result is nonzero.
(iswprint): Use ISPRINT when substituting our own mbrtowc.
Diffstat (limited to 'lib')
-rw-r--r--lib/quotearg.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 2483164a6..902192e70 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -64,15 +64,18 @@
# 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)