diff --git a/contrib/one-true-awk/b.c b/contrib/one-true-awk/b.c --- a/contrib/one-true-awk/b.c +++ b/contrib/one-true-awk/b.c @@ -361,20 +361,9 @@ return c; } -static int collate_range_cmp(int a, int b) -{ - static char s[2][2]; - - if ((uschar)a == (uschar)b) - return 0; - s[0][0] = a; - s[1][0] = b; - return (strcoll(s[0], s[1])); -} - char *cclenter(const char *argp) /* add a character class */ { - int i, c, c2, j; + int i, c, c2; const uschar *op, *p = (const uschar *) argp; uschar *bp; static uschar *buf = NULL; @@ -393,18 +382,15 @@ c2 = *p++; if (c2 == '\\') c2 = quoted(&p); - if (collate_range_cmp(c, c2) > 0) { + if (c > c2) { /* empty; ignore */ bp--; i--; continue; } - for (j = 0; j < NCHARS; j++) { - if ((collate_range_cmp(c, j) > 0) || - collate_range_cmp(j, c2) > 0) - continue; + while (c < c2) { if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) FATAL("out of space for character class [%.10s...] 2", p); - *bp++ = j; + *bp++ = ++c; i++; } continue; diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c --- a/contrib/one-true-awk/main.c +++ b/contrib/one-true-awk/main.c @@ -117,7 +117,6 @@ char *fn, *vn; setlocale(LC_CTYPE, ""); - setlocale(LC_COLLATE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = argv[0]; if (argc == 1) { diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -665,7 +665,7 @@ j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { - i = strcoll(getsval(x), getsval(y)); + i = strcmp(getsval(x), getsval(y)); } tempfree(x); tempfree(y);