mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +01:00
23071: signed characters with no multibyte support
This commit is contained in:
parent
3778f5a3ba
commit
507c58262a
2 changed files with 11 additions and 3 deletions
11
Src/utils.c
11
Src/utils.c
|
|
@ -4146,15 +4146,20 @@ mb_metastrlen(char *ptr, int width)
|
|||
|
||||
/**/
|
||||
mod_export int
|
||||
metacharlenconv(char *x, int *c)
|
||||
metacharlenconv(const char *x, int *c)
|
||||
{
|
||||
/*
|
||||
* Here we don't use STOUC() on the chars since they
|
||||
* may be compared against other chars and this will fail
|
||||
* if chars are signed and the high bit is set.
|
||||
*/
|
||||
if (*x == Meta) {
|
||||
if (c)
|
||||
*c = STOUC(x[1]) ^ 32;
|
||||
*c = x[1] ^ 32;
|
||||
return 2;
|
||||
}
|
||||
if (c)
|
||||
*c = STOUC(*x);
|
||||
*c = (char)*x;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue