From 894a3cd7e9564348bbb3905ec0f8cc42d970109f Mon Sep 17 00:00:00 2001 From: espie <> Date: Mon, 8 Aug 2005 05:53:01 +0000 Subject: [PATCH] activate LC_CTYPE for 8 bits locale. Make sure tolower/toupper use the whole 8 bits. okay deraadt@ thanks to everyone who tested --- src/include/ctype.h | 6 +++--- src/lib/libc/string/wcscmp.c | 6 +++--- src/lib/libc/string/wcsncmp.c | 8 ++++---- src/lib/libc/string/wmemcmp.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/include/ctype.h b/src/include/ctype.h index 753c68a7..25f551d9 100644 --- a/src/include/ctype.h +++ b/src/include/ctype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ctype.h,v 1.17 2004/04/02 22:37:12 avsm Exp $ */ +/* $OpenBSD: ctype.h,v 1.18 2005/08/08 05:53:00 espie Exp $ */ /* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */ /* @@ -147,14 +147,14 @@ __CTYPE_INLINE int isxdigit(int c) __CTYPE_INLINE int tolower(int c) { - if ((unsigned int)c > 0177) + if ((unsigned int)c > 255) return (c); return ((_tolower_tab_ + 1)[c]); } __CTYPE_INLINE int toupper(int c) { - if ((unsigned int)c > 0177) + if ((unsigned int)c > 255) return (c); return ((_toupper_tab_ + 1)[c]); } diff --git a/src/lib/libc/string/wcscmp.c b/src/lib/libc/string/wcscmp.c index d8a9aa73..ebbb87ca 100644 --- a/src/lib/libc/string/wcscmp.c +++ b/src/lib/libc/string/wcscmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ +/* $OpenBSD: wcscmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */ /* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /*- @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; +static char *rcsid = "$OpenBSD: wcscmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -51,5 +51,5 @@ wcscmp(const wchar_t *s1, const wchar_t *s2) if (*s1++ == 0) return (0); /* XXX assumes wchar_t = int */ - return (*(const __nbrune_t *)s1 - *(const __nbrune_t *)--s2); + return (*(const rune_t *)s1 - *(const rune_t *)--s2); } diff --git a/src/lib/libc/string/wcsncmp.c b/src/lib/libc/string/wcsncmp.c index aaa96b97..30d37f66 100644 --- a/src/lib/libc/string/wcsncmp.c +++ b/src/lib/libc/string/wcsncmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ +/* $OpenBSD: wcsncmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */ /* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /* @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; +static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -46,8 +46,8 @@ wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) do { if (*s1 != *s2++) { /* XXX assumes wchar_t = int */ - return (*(const __nbrune_t *)s1 - - *(const __nbrune_t *)--s2); + return (*(const rune_t *)s1 - + *(const rune_t *)--s2); } if (*s1++ == 0) break; diff --git a/src/lib/libc/string/wmemcmp.c b/src/lib/libc/string/wmemcmp.c index fc021c11..e35c6207 100644 --- a/src/lib/libc/string/wmemcmp.c +++ b/src/lib/libc/string/wmemcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ +/* $OpenBSD: wmemcmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */ /* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */ /*- @@ -30,7 +30,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; +static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -44,8 +44,8 @@ wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n) for (i = 0; i < n; i++) { if (*s1 != *s2) { /* wchar might be unsigned */ - return *(const __nbrune_t *)s1 > - *(const __nbrune_t *)s2 ? 1 : -1; + return *(const rune_t *)s1 > + *(const rune_t *)s2 ? 1 : -1; } s1++; s2++;