Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148111835
D31114.1785414403.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31114.1785414403.diff
View Options
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);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 30, 12:26 PM (13 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29308884
Default Alt Text
D31114.1785414403.diff (1 KB)
Attached To
Mode
D31114: awk: revert to upstream behavior for ranges for gawk compatibility
Attached
Detach File
Event Timeline
Log In to Comment