From 507c58262a4d2b09f8ce58539fd497c6ecc2c5fc Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 19 Dec 2006 13:01:43 +0000 Subject: 23071: signed characters with no multibyte support --- Src/utils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/utils.c b/Src/utils.c index a0f762896..d4bf6c2eb 100644 --- a/Src/utils.c +++ b/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; } -- cgit 1.4.1