From 30ce15b19102abe594a598b8ce48343a1f8dc1b2 Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 23 Oct 1996 15:35:46 +0000 Subject: Simplify debug output Simplify collate_range_cmp for ASCII-compatible collate we have now --- lib/libc/locale/collate.c | 3 ++- lib/libc/locale/collcmp.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index d068333..97522192 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: collate.c,v 1.6 1996/09/14 02:57:25 bde Exp $ + * $Id: collate.c,v 1.7 1996/10/15 21:53:22 ache Exp $ */ #include @@ -180,6 +180,7 @@ __collate_print_tables() printf("Substitute table:\n"); for (i = 0; i < UCHAR_MAX + 1; i++) + if (i != *__collate_substitute_table[i]) printf("\t'%c' --> \"%s\"\n", i, __collate_substitute_table[i]); printf("Chain priority table:\n"); diff --git a/lib/libc/locale/collcmp.c b/lib/libc/locale/collcmp.c index c5acf73..1776033 100644 --- a/lib/libc/locale/collcmp.c +++ b/lib/libc/locale/collcmp.c @@ -23,13 +23,17 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: collcmp.c,v 1.5 1996/08/14 19:47:02 ache Exp $ + * $Id: collcmp.c,v 1.6 1996/09/17 19:27:06 ache Exp $ */ -#include +#define ASCII_COMPATIBLE_COLLATE /* see usr.bin/colldef/data */ + #include #include #include +#ifndef ASCII_COMPATIBLE_COLLATE +#include +#endif /* * Compare two characters converting collate information @@ -40,14 +44,18 @@ int collate_range_cmp (c1, c2) int c1, c2; { - int as1, as2, al1, al2, ret; static char s1[2], s2[2]; + int ret; +#ifndef ASCII_COMPATIBLE_COLLATE + int as1, as2, al1, al2; +#endif c1 &= UCHAR_MAX; c2 &= UCHAR_MAX; if (c1 == c2) return (0); +#ifndef ASCII_COMPATIBLE_COLLATE as1 = isascii(c1); as2 = isascii(c2); al1 = isalpha(c1); @@ -68,7 +76,7 @@ int collate_range_cmp (c1, c2) return (c1 - 'a'); } } - +#endif s1[0] = c1; s2[0] = c2; if ((ret = strcoll(s1, s2)) != 0) -- cgit v1.1