summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-11-01 02:50:24 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-11-01 02:50:24 +0000
commitdbac6846fa448278aa661c68c96420874d1bea47 (patch)
tree08afe98ed61387aab04d87dd22a00e2ad2baefea
parent232824511b64d6ecbe3cf8c60f2a98894fe3f7e8 (diff)
downloadzsh-dbac6846fa448278aa661c68c96420874d1bea47.tar.gz
zsh-dbac6846fa448278aa661c68c96420874d1bea47.zip
- 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.
-rw-r--r--Src/utils.c14
1 files changed, 12 insertions, 2 deletions
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 */