mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 06:20:55 +01:00
- 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.
This commit is contained in:
parent
232824511b
commit
dbac6846fa
1 changed files with 12 additions and 2 deletions
14
Src/utils.c
14
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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue