mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
Simplify debug output
Simplify collate_range_cmp for ASCII-compatible collate we have now
This commit is contained in:
parent
6ab9285573
commit
967a5cb181
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19129
@ -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");
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user