diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-12 12:19:11 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-12 12:19:11 +0000 |
| commit | de6c9c9d5bf3ec1f15d6196253f08c327a504fa7 (patch) | |
| tree | 802ec2593ce866aa0d0473bfc2cd7c04d0f9cd00 /lib/libc | |
| parent | b9de27c0051bd9c4ce167327b5824a31baee1474 (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/locale/wcwidth.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/libc/locale/wcwidth.c b/lib/libc/locale/wcwidth.c index 9706430de888..f7dababfd796 100644 --- a/lib/libc/locale/wcwidth.c +++ b/lib/libc/locale/wcwidth.c @@ -43,21 +43,12 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> -#include <wctype.h> -#define _CTYPE_SWM 0xe0000000L /* Mask to get screen width data */ -#define _CTYPE_SWS 30 /* Bits to shift to get width */ +#undef wcwidth int wcwidth(wchar_t wc) { - unsigned int x; - if (wc == L'\0') - return (0); - - x = (unsigned int)__maskrune(wc, _CTYPE_SWM|_CTYPE_R); - if ((x & _CTYPE_SWM) != 0) - return ((x & _CTYPE_SWM) >> _CTYPE_SWS); - return ((x & _CTYPE_R) != 0 ? 1 : -1); + return (__wcwidth(wc)); } |
