From dbac6846fa448278aa661c68c96420874d1bea47 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 1 Nov 2005 02:50:24 +0000 Subject: - Added the wcsiblank() function for wide-char blank-checking that does not match '\n'. - Fixed a couple calls to isascii() that were passing a "char" value. --- Src/utils.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index cf84d5f85..58bf3286f 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -2619,6 +2619,16 @@ inittyptab(void) #ifdef MULTIBYTE_SUPPORT +/* A wide-character version of the iblank() macro. */ +/**/ +mod_export int +wcsiblank(wint_t wc) +{ + if (iswspace(wc) && wc != L'\n') + return 1; + return 0; +} + /* * iword() macro extended to support wide characters. */ @@ -2641,7 +2651,7 @@ wcsiword(wchar_t c) if (len == 0) { /* NULL is special */ return iword(0); - } else if (len == 1 && isascii(*outstr)) { + } else if (len == 1 && iascii(*outstr)) { return iword(*outstr); } else { return iswalnum(c) || wcschr(wordchars_wide, c); @@ -2673,7 +2683,7 @@ wcsiident(wchar_t c) if (len == 0) { /* NULL is special */ return 0; - } else if (len == 1 && isascii(*outstr)) { + } else if (len == 1 && iascii(*outstr)) { return iident(*outstr); } else { /* not currently allowed, see above */ -- cgit 1.4.1