summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorespie <>2005-08-08 05:53:01 +0000
committerespie <>2005-08-08 05:53:01 +0000
commit63dd09a8c91fcf1f022506ffd9fcf02dcb61818b (patch)
treea40171ec7c45f79ef44a5d2b2991fdaa92410578 /src
parent5cf81f9663bfb2af55273bd020c777bacc636110 (diff)
downloadopenbsd-63dd09a8c91fcf1f022506ffd9fcf02dcb61818b.tar.gz
openbsd-63dd09a8c91fcf1f022506ffd9fcf02dcb61818b.tar.bz2
openbsd-63dd09a8c91fcf1f022506ffd9fcf02dcb61818b.zip
activate LC_CTYPE for 8 bits locale.
Make sure tolower/toupper use the whole 8 bits. okay deraadt@ thanks to everyone who tested
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/include/ctype_private.h7
-rw-r--r--src/lib/libc/string/wcscmp.c6
-rw-r--r--src/lib/libc/string/wcsncmp.c8
-rw-r--r--src/lib/libc/string/wmemcmp.c8
4 files changed, 18 insertions, 11 deletions
diff --git a/src/lib/libc/include/ctype_private.h b/src/lib/libc/include/ctype_private.h
new file mode 100644
index 0000000000..39cc792ea4
--- /dev/null
+++ b/src/lib/libc/include/ctype_private.h
@@ -0,0 +1,7 @@
1/* $OpenBSD: ctype_private.h,v 1.1 2005/08/08 05:53:00 espie Exp $ */
2/* Written by Marc Espie, public domain */
3#define CTYPE_NUM_CHARS 256
4extern const char _C_ctype_[];
5extern const short _C_toupper_[];
6extern const short _C_tolower_[];
7
diff --git a/src/lib/libc/string/wcscmp.c b/src/lib/libc/string/wcscmp.c
index d8a9aa73fb..ebbb87ca4d 100644
--- a/src/lib/libc/string/wcscmp.c
+++ b/src/lib/libc/string/wcscmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ 1/* $OpenBSD: wcscmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */
2/* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ 2/* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
3 3
4/*- 4/*-
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; 37static char *rcsid = "$OpenBSD: wcscmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <wchar.h> 40#include <wchar.h>
@@ -51,5 +51,5 @@ wcscmp(const wchar_t *s1, const wchar_t *s2)
51 if (*s1++ == 0) 51 if (*s1++ == 0)
52 return (0); 52 return (0);
53 /* XXX assumes wchar_t = int */ 53 /* XXX assumes wchar_t = int */
54 return (*(const __nbrune_t *)s1 - *(const __nbrune_t *)--s2); 54 return (*(const rune_t *)s1 - *(const rune_t *)--s2);
55} 55}
diff --git a/src/lib/libc/string/wcsncmp.c b/src/lib/libc/string/wcsncmp.c
index aaa96b97a6..30d37f6657 100644
--- a/src/lib/libc/string/wcsncmp.c
+++ b/src/lib/libc/string/wcsncmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ 1/* $OpenBSD: wcsncmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */
2/* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ 2/* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
3 3
4/* 4/*
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; 34static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $";
35#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
36 36
37#include <wchar.h> 37#include <wchar.h>
@@ -46,8 +46,8 @@ wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
46 do { 46 do {
47 if (*s1 != *s2++) { 47 if (*s1 != *s2++) {
48 /* XXX assumes wchar_t = int */ 48 /* XXX assumes wchar_t = int */
49 return (*(const __nbrune_t *)s1 - 49 return (*(const rune_t *)s1 -
50 *(const __nbrune_t *)--s2); 50 *(const rune_t *)--s2);
51 } 51 }
52 if (*s1++ == 0) 52 if (*s1++ == 0)
53 break; 53 break;
diff --git a/src/lib/libc/string/wmemcmp.c b/src/lib/libc/string/wmemcmp.c
index fc021c11d1..e35c6207ff 100644
--- a/src/lib/libc/string/wmemcmp.c
+++ b/src/lib/libc/string/wmemcmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */ 1/* $OpenBSD: wmemcmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $ */
2/* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */ 2/* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */
3 3
4/*- 4/*-
@@ -30,7 +30,7 @@
30 */ 30 */
31 31
32#if defined(LIBC_SCCS) && !defined(lint) 32#if defined(LIBC_SCCS) && !defined(lint)
33static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $"; 33static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.3 2005/08/08 05:53:01 espie Exp $";
34#endif /* LIBC_SCCS and not lint */ 34#endif /* LIBC_SCCS and not lint */
35 35
36#include <wchar.h> 36#include <wchar.h>
@@ -44,8 +44,8 @@ wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
44 for (i = 0; i < n; i++) { 44 for (i = 0; i < n; i++) {
45 if (*s1 != *s2) { 45 if (*s1 != *s2) {
46 /* wchar might be unsigned */ 46 /* wchar might be unsigned */
47 return *(const __nbrune_t *)s1 > 47 return *(const rune_t *)s1 >
48 *(const __nbrune_t *)s2 ? 1 : -1; 48 *(const rune_t *)s2 ? 1 : -1;
49 } 49 }
50 s1++; 50 s1++;
51 s2++; 51 s2++;