summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-10-23 15:35:46 +0000
committerache <ache@FreeBSD.org>1996-10-23 15:35:46 +0000
commit30ce15b19102abe594a598b8ce48343a1f8dc1b2 (patch)
treea52a8402d90f52a3f488f9bce66d4e522e69c2ea /lib
parent3b9a16cb5063881459285cd4d6d527b6c2aa0dad (diff)
downloadFreeBSD-src-30ce15b19102abe594a598b8ce48343a1f8dc1b2.zip
FreeBSD-src-30ce15b19102abe594a598b8ce48343a1f8dc1b2.tar.gz
Simplify debug output
Simplify collate_range_cmp for ASCII-compatible collate we have now
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/locale/collate.c3
-rw-r--r--lib/libc/locale/collcmp.c16
2 files changed, 14 insertions, 5 deletions
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 <rune.h>
@@ -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 <ctype.h>
+#define ASCII_COMPATIBLE_COLLATE /* see usr.bin/colldef/data */
+
#include <string.h>
#include <limits.h>
#include <locale.h>
+#ifndef ASCII_COMPATIBLE_COLLATE
+#include <ctype.h>
+#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)
OpenPOWER on IntegriCloud