projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6589d05
)
Assume an ASCII compatible wide character encoding.
author
Bruno Haible
<bruno@clisp.org>
Fri, 28 Jul 2006 15:31:45 +0000
(15:31 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Fri, 28 Jul 2006 15:31:45 +0000
(15:31 +0000)
lib/mbswidth.c
patch
|
blob
|
history
lib/wcwidth.h
patch
|
blob
|
history
diff --git
a/lib/mbswidth.c
b/lib/mbswidth.c
index 48da6639dc112e683eeba4b546caf0241609cff5..072695172b5f33376f7cc42ca804a5cc1d286483 100644
(file)
--- a/
lib/mbswidth.c
+++ b/
lib/mbswidth.c
@@
-51,7
+51,7
@@
# include <wctype.h>
#endif
#if !defined iswcntrl && !HAVE_ISWCNTRL
-# define iswcntrl(wc)
0
+# define iswcntrl(wc)
(((wc) & ~0x1f) == 0 || (wc) == 0x7f)
#endif
#ifndef mbsinit
diff --git
a/lib/wcwidth.h
b/lib/wcwidth.h
index 9af75e0a775841d38a455f232a5bd0429fa8d2bb..1c95d0e11b562901469ceaf6635f6b62aac2ce06 100644
(file)
--- a/
lib/wcwidth.h
+++ b/
lib/wcwidth.h
@@
-36,7
+36,13
@@
# include <wctype.h>
# endif
# if !defined iswprint && !HAVE_ISWPRINT
-# define iswprint(wc) 1
+ststic inline int
+iswprint (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= ' ' && wc <= '~'
+ : 1);
+}
# endif
# ifndef HAVE_DECL_WCWIDTH