diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2007-10-09 15:28:15 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2007-10-09 15:28:15 +0000 |
| commit | c9ce363ec52cb85e4699fd0e72409d1c1db118d5 (patch) | |
| tree | 2eaa0deb25579af8fd5f091f323349bf1000aedb /usr.bin/awk | |
| parent | ce126fdf7b9b786073afd3f440edf7d72c361bf9 (diff) | |
Notes
Diffstat (limited to 'usr.bin/awk')
| -rw-r--r-- | usr.bin/awk/Makefile | 6 | ||||
| -rw-r--r-- | usr.bin/awk/b.c.diff | 53 | ||||
| -rw-r--r-- | usr.bin/awk/lib.c.diff | 18 | ||||
| -rw-r--r-- | usr.bin/awk/main.c.diff | 69 | ||||
| -rw-r--r-- | usr.bin/awk/run.c.diff | 18 | ||||
| -rw-r--r-- | usr.bin/awk/tran.c.diff | 22 |
6 files changed, 0 insertions, 186 deletions
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile index 3cd4aa8cc3d9..1d3642b6a832 100644 --- a/usr.bin/awk/Makefile +++ b/usr.bin/awk/Makefile @@ -29,10 +29,4 @@ CLEANFILES+= nawk.1 nawk.1: awk.1 cat ${.ALLSRC} > ${.TARGET} -.for f in b.c lib.c main.c run.c tran.c -${f}: ${AWKSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${AWKSRC}/${f} -CLEANFILES+= ${f} -.endfor - .include <bsd.prog.mk> diff --git a/usr.bin/awk/b.c.diff b/usr.bin/awk/b.c.diff deleted file mode 100644 index 2f6b2225c9ec..000000000000 --- a/usr.bin/awk/b.c.diff +++ /dev/null @@ -1,53 +0,0 @@ -$FreeBSD$ - -Index: b.c -=================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/b.c,v -retrieving revision 1.1.1.8 -diff -u -p -r1.1.1.8 b.c ---- b.c 16 May 2005 19:11:31 -0000 1.1.1.8 -+++ b.c 16 May 2005 19:12:40 -0000 -@@ -282,9 +282,21 @@ int quoted(char **pp) /* pick up next th - 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; -@@ -303,15 +315,18 @@ char *cclenter(const char *argp) /* add - 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, 0)) - FATAL("out of space for character class [%.10s...] 2", p); -- *bp++ = ++c; -+ *bp++ = j; - i++; - } - continue; diff --git a/usr.bin/awk/lib.c.diff b/usr.bin/awk/lib.c.diff deleted file mode 100644 index 040485a64131..000000000000 --- a/usr.bin/awk/lib.c.diff +++ /dev/null @@ -1,18 +0,0 @@ -$FreeBSD$ - -Index: lib.c -=================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/lib.c,v -retrieving revision 1.1.1.4 -diff -u -p -r1.1.1.4 lib.c ---- lib.c 16 May 2005 19:11:33 -0000 1.1.1.4 -+++ lib.c 15 Sep 2006 10:10:59 -0000 -@@ -58,7 +58,7 @@ static Cell dollar1 = { OCELL, CFLD, NUL - void recinit(unsigned int n) - { - if ( (record = (char *) malloc(n)) == NULL -- || (fields = (char *) malloc(n)) == NULL -+ || (fields = (char *) malloc(n+1)) == NULL - || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL - || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL ) - FATAL("out of space for $0 and fields"); diff --git a/usr.bin/awk/main.c.diff b/usr.bin/awk/main.c.diff deleted file mode 100644 index e69a42d2c2f0..000000000000 --- a/usr.bin/awk/main.c.diff +++ /dev/null @@ -1,69 +0,0 @@ -$FreeBSD$ - -Index: main.c -=================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/main.c,v -retrieving revision 1.1.1.10 -diff -u -p -r1.1.1.10 main.c ---- main.c 16 May 2005 19:11:31 -0000 1.1.1.10 -+++ main.c 15 Sep 2006 13:21:30 -0000 -@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE - THIS SOFTWARE. - ****************************************************************/ - --const char *version = "version 20050424"; -+const char *version = "version 20050424 (FreeBSD)"; - - #define DEBUG - #include <stdio.h> -@@ -58,6 +58,7 @@ int main(int argc, char *argv[]) - const char *fs = NULL; - - setlocale(LC_CTYPE, ""); -+ setlocale(LC_COLLATE, ""); - setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ - cmdname = argv[0]; - if (argc == 1) { -@@ -79,13 +80,18 @@ int main(int argc, char *argv[]) - safe = 1; - break; - case 'f': /* next argument is program filename */ -- argc--; -- argv++; -- if (argc <= 1) -- FATAL("no program filename"); -- if (npfile >= MAX_PFILE - 1) -- FATAL("too many -f options"); -- pfile[npfile++] = argv[1]; -+ if (argv[1][2] != 0) { /* arg is -fsomething */ -+ if (npfile >= MAX_PFILE - 1) -+ FATAL("too many -f options"); -+ pfile[npfile++] = &argv[1][2]; -+ } else { /* arg is -f something */ -+ argc--; argv++; -+ if (argc <= 1) -+ FATAL("no program filename"); -+ if (npfile >= MAX_PFILE - 1) -+ FATAL("too many -f options"); -+ pfile[npfile++] = argv[1]; -+ } - break; - case 'F': /* set field separator */ - if (argv[1][2] != 0) { /* arg is -Fsomething */ -@@ -104,8 +110,14 @@ int main(int argc, char *argv[]) - WARNING("field separator FS is empty"); - break; - case 'v': /* -v a=1 to be done NOW. one -v for each */ -- if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1])) -- setclvar(argv[1]); -+ if (argv[1][2] != 0) { /* arg is -vsomething */ -+ if (argv[1][2] != 0) -+ setclvar(&argv[1][2]); -+ } else { /* arg is -v something */ -+ argc--; argv++; -+ if (argc > 1 && isclvar(argv[1])) -+ setclvar(argv[1]); -+ } - break; - case 'm': /* more memory: -mr=record, -mf=fields */ - /* no longer supported */ diff --git a/usr.bin/awk/run.c.diff b/usr.bin/awk/run.c.diff deleted file mode 100644 index d4912507ee5c..000000000000 --- a/usr.bin/awk/run.c.diff +++ /dev/null @@ -1,18 +0,0 @@ -$FreeBSD$ - -Index: run.c -=================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/run.c,v -retrieving revision 1.1.1.8 -diff -u -p -r1.1.1.8 run.c ---- run.c 16 May 2005 19:11:35 -0000 1.1.1.8 -+++ run.c 16 May 2005 19:12:47 -0000 -@@ -651,7 +651,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[ - j = x->fval - y->fval; - i = j<0? -1: (j>0? 1: 0); - } else { -- i = strcmp(getsval(x), getsval(y)); -+ i = strcoll(getsval(x), getsval(y)); - } - tempfree(x); - tempfree(y); diff --git a/usr.bin/awk/tran.c.diff b/usr.bin/awk/tran.c.diff deleted file mode 100644 index 18f0f588b7e2..000000000000 --- a/usr.bin/awk/tran.c.diff +++ /dev/null @@ -1,22 +0,0 @@ -$FreeBSD$ - -Index: tran.c -=================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/tran.c,v -retrieving revision 1.1.1.4 -diff -u -p -r1.1.1.4 tran.c ---- tran.c 16 May 2005 19:11:35 -0000 1.1.1.4 -+++ tran.c 25 Oct 2006 20:56:18 -0000 -@@ -332,10 +332,10 @@ char *setsval(Cell *vp, const char *s) / - donerec = 1; - } - t = tostring(s); /* in case it's self-assign */ -- vp->tval &= ~NUM; -- vp->tval |= STR; - if (freeable(vp)) - xfree(vp->sval); -+ vp->tval &= ~NUM; -+ vp->tval |= STR; - vp->tval &= ~DONTFREE; - dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", - vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); |
