Module Name: src
Committed By: yamt
Date: Thu May 22 14:07:36 UTC 2014
Modified Files:
src/external/historical/nawk/bin [yamt-pagecache]: Makefile awk.1
src/external/historical/nawk/dist [yamt-pagecache]: lib.c run.c tran.c
Log Message:
sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
To generate a diff of this commit:
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/external/historical/nawk/bin/Makefile
cvs rdiff -u -r1.2 -r1.2.4.1 src/external/historical/nawk/bin/awk.1
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/external/historical/nawk/dist/lib.c
cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/external/historical/nawk/dist/run.c
cvs rdiff -u -r1.5.4.2 -r1.5.4.3 src/external/historical/nawk/dist/tran.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/historical/nawk/bin/Makefile
diff -u src/external/historical/nawk/bin/Makefile:1.8.2.1 src/external/historical/nawk/bin/Makefile:1.8.2.2
--- src/external/historical/nawk/bin/Makefile:1.8.2.1 Tue Oct 30 18:57:59 2012
+++ src/external/historical/nawk/bin/Makefile Thu May 22 14:07:36 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8.2.1 2012/10/30 18:57:59 yamt Exp $
+# $NetBSD: Makefile,v 1.8.2.2 2014/05/22 14:07:36 yamt Exp $
WARNS?= 4
CWARNFLAGS.clang+= -Wno-self-assign
@@ -17,9 +17,9 @@ LDADD+= -lm
DPADD+= ${LIBM}
.endif
YHEADER= yes
-COPTS+= -Wno-pointer-sign
-COPTS.run.c += -Wno-format-nonliteral
-COPTS.tran.c += -Wno-format-nonliteral
+CWARNFLAGS+= -Wno-pointer-sign
+COPTS.run.c+= -Wno-format-nonliteral
+COPTS.tran.c+= -Wno-format-nonliteral
# info file originally from GNU awk 3.1.3, adjusted for nawk slightly
.PATH: ${NETBSDSRCDIR}/external/gpl2/gawk/dist
Index: src/external/historical/nawk/bin/awk.1
diff -u src/external/historical/nawk/bin/awk.1:1.2 src/external/historical/nawk/bin/awk.1:1.2.4.1
--- src/external/historical/nawk/bin/awk.1:1.2 Wed Apr 20 10:10:32 2011
+++ src/external/historical/nawk/bin/awk.1 Thu May 22 14:07:36 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: awk.1,v 1.2 2011/04/20 10:10:32 drochner Exp $
+.\" $NetBSD: awk.1,v 1.2.4.1 2014/05/22 14:07:36 yamt Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
@@ -419,8 +419,8 @@ supported by GNU
are
.Em not
supported at this moment.
-.It Fn gsub r t "[s]"
-same as
+.It Fn gsub r s "[t]"
+Same as
.Fn sub
except that all occurrences of the regular expression
are replaced;
@@ -477,13 +477,13 @@ according to the
.Xr printf 3
format
.Ar fmt .
-.It Fn sub r t "[s]"
+.It Fn sub r s "[t]"
substitutes
-.Ar t
+.Ar s
for the first occurrence of the regular expression
.Ar r
-in the string
-.Ar s .
+in the target string
+.Ar t .
If
.Ar s
is not given,
Index: src/external/historical/nawk/dist/lib.c
diff -u src/external/historical/nawk/dist/lib.c:1.4.4.2 src/external/historical/nawk/dist/lib.c:1.4.4.3
--- src/external/historical/nawk/dist/lib.c:1.4.4.2 Wed Jan 23 00:04:46 2013
+++ src/external/historical/nawk/dist/lib.c Thu May 22 14:07:36 2014
@@ -753,10 +753,9 @@ int isclvar(const char *s) /* is s of fo
#include <math.h>
int is_number(const char *s)
{
- double r;
char *ep;
errno = 0;
- r = strtod(s, &ep);
+ (void)strtod(s, &ep);
if (ep == s || errno == ERANGE)
return 0;
if (ep - s >= 3 && strncasecmp(ep - 3, "nan", 3) == 0)
Index: src/external/historical/nawk/dist/run.c
diff -u src/external/historical/nawk/dist/run.c:1.3.4.2 src/external/historical/nawk/dist/run.c:1.3.4.3
--- src/external/historical/nawk/dist/run.c:1.3.4.2 Wed Jan 23 00:04:46 2013
+++ src/external/historical/nawk/dist/run.c Thu May 22 14:07:36 2014
@@ -1647,6 +1647,8 @@ Cell *bltin(Node **a, int n) /* builtin
} else
tv = time((time_t *) 0);
tm = localtime(&tv);
+ if (tm == NULL)
+ FATAL("bad time %jd", (intmax_t)tv);
if (isrec(x)) {
/* format argument not provided, use default */
@@ -2074,6 +2076,7 @@ Cell *gensub(Node **a, int nnn) /* globa
x = execute(a[4]); /* source string */
t = getsval(x);
res = copycell(x); /* target string - initially copy of source */
+ res->csub = CTEMP; /* result values are temporary */
if (a[0] == 0) /* 0 => a[1] is already-compiled regexpr */
pfa = (fa *) a[1]; /* regular expression */
else {
Index: src/external/historical/nawk/dist/tran.c
diff -u src/external/historical/nawk/dist/tran.c:1.5.4.2 src/external/historical/nawk/dist/tran.c:1.5.4.3
--- src/external/historical/nawk/dist/tran.c:1.5.4.2 Wed Jan 23 00:04:46 2013
+++ src/external/historical/nawk/dist/tran.c Thu May 22 14:07:36 2014
@@ -358,7 +358,7 @@ char *setsval(Cell *vp, const char *s) /
donefld = 0; /* mark $1... invalid */
donerec = 1;
}
- t = tostring(s); /* in case it's self-assign */
+ t = s ? tostring(s) : tostring(""); /* in case it's self-assign */
if (freeable(vp))
xfree(vp->sval);
vp->tval &= ~NUM;