4 ===================================================================
5 RCS file: /home/ncvs/src/contrib/one-true-awk/b.c,v
6 retrieving revision 1.1.1.8
7 diff -u -p -r1.1.1.8 b.c
8 --- b.c 16 May 2005 19:11:31 -0000 1.1.1.8
9 +++ b.c 16 May 2005 19:12:40 -0000
10 @@ -282,9 +282,21 @@ int quoted(char **pp) /* pick up next th
14 +static int collate_range_cmp(int a, int b)
16 + static char s[2][2];
18 + if ((uschar)a == (uschar)b)
22 + return (strcoll(s[0], s[1]));
25 char *cclenter(const char *argp) /* add a character class */
29 uschar *p = (uschar *) argp;
31 static uschar *buf = 0;
32 @@ -303,15 +315,18 @@ char *cclenter(const char *argp) /* add
35 c2 = quoted((char **) &p);
36 - if (c > c2) { /* empty; ignore */
37 + if (collate_range_cmp(c, c2) > 0) {
43 + for (j = 0; j < NCHARS; j++) {
44 + if ((collate_range_cmp(c, j) > 0) ||
45 + collate_range_cmp(j, c2) > 0)
47 if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1"))
48 FATAL("out of space for character class [%.10s...] 2", p);