diff options
author | ru <ru@FreeBSD.org> | 2010-01-10 08:02:07 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2010-01-10 08:02:07 +0000 |
commit | 270ba02de1ffa85c9293d73669cae997f42c62b1 (patch) | |
tree | f4923317980c5c94957c3b5a4b1c4906654e92d1 /usr.bin/awk/b.c.diff | |
parent | dd1716139623593608ab5a62cd153c48b97bd043 (diff) | |
download | FreeBSD-src-270ba02de1ffa85c9293d73669cae997f42c62b1.zip FreeBSD-src-270ba02de1ffa85c9293d73669cae997f42c62b1.tar.gz |
Apply patches directly to sources. Their effect is as follows:
- Make one-true-awk respect locale's collating order in [a-z]
bracket expressions, until a more complete fix (like handing
BREs) is ready.
- Don't require a space between -[fv] and its argument.
Diffstat (limited to 'usr.bin/awk/b.c.diff')
-rw-r--r-- | usr.bin/awk/b.c.diff | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/usr.bin/awk/b.c.diff b/usr.bin/awk/b.c.diff deleted file mode 100644 index 5b4905e..0000000 --- a/usr.bin/awk/b.c.diff +++ /dev/null @@ -1,50 +0,0 @@ -$FreeBSD$ - -Index: b.c -=================================================================== ---- b.c (revision 201951) -+++ b.c (working copy) -@@ -285,9 +285,21 @@ int quoted(char **pp) /* pick up next thing after - 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; -+ int j; - uschar *p = (uschar *) argp; - uschar *op, *bp; - static uschar *buf = 0; -@@ -306,15 +318,18 @@ char *cclenter(const char *argp) /* add a characte - c2 = *p++; - if (c2 == '\\') - c2 = quoted((char **) &p); -- if (c > c2) { /* empty; ignore */ -+ if (collate_range_cmp(c, c2) > 0) { - bp--; - i--; - continue; - } -- while (c < c2) { -+ for (j = 0; j < NCHARS; j++) { -+ if ((collate_range_cmp(c, j) > 0) || -+ collate_range_cmp(j, c2) > 0) -+ continue; - if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) - FATAL("out of space for character class [%.10s...] 2", p); -- *bp++ = ++c; -+ *bp++ = j; - i++; - } - continue; |