diff options
author | ru <ru@FreeBSD.org> | 2010-01-15 14:20:01 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2010-01-15 14:20:01 +0000 |
commit | 07b41d1dea4377da3e53d34b28f9db00442a430f (patch) | |
tree | 2f8cfc8fde1b95cc83d446e84d108021e1ed9ead /usr.bin/awk | |
parent | 375bdd5dd94b75168ccde046ade171b93274cf57 (diff) | |
download | FreeBSD-src-07b41d1dea4377da3e53d34b28f9db00442a430f.zip FreeBSD-src-07b41d1dea4377da3e53d34b28f9db00442a430f.tar.gz |
Update to a 26-Nov-2009 release.
Diffstat (limited to 'usr.bin/awk')
-rw-r--r-- | usr.bin/awk/Makefile | 8 | ||||
-rw-r--r-- | usr.bin/awk/b.c.diff | 53 | ||||
-rw-r--r-- | usr.bin/awk/main.c.diff | 69 | ||||
-rw-r--r-- | usr.bin/awk/run.c.diff | 18 |
4 files changed, 2 insertions, 146 deletions
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile index 7ec2e57..6538636 100644 --- a/usr.bin/awk/Makefile +++ b/usr.bin/awk/Makefile @@ -8,6 +8,8 @@ SRCS= awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c ytab.h CFLAGS+= -DHAS_ISBLANK -I. -I${AWKSRC} -DFOPEN_MAX=64 +WARNS?= 1 + DPADD= ${LIBM} LDADD= -lm @@ -25,10 +27,4 @@ proctab.c: maketab build-tools: maketab maketab: ytab.h ${AWKSRC}/maketab.c -.for f in b.c main.c run.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 525fcbc..0000000 --- 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, "cclenter1")) - FATAL("out of space for character class [%.10s...] 2", p); -- *bp++ = ++c; -+ *bp++ = j; - i++; - } - continue; diff --git a/usr.bin/awk/main.c.diff b/usr.bin/awk/main.c.diff deleted file mode 100644 index 252cd5a..0000000 --- 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 20070501"; -+const char *version = "version 20070501 (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 d491250..0000000 --- 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); |