summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-10-25 21:23:20 +0000
committerru <ru@FreeBSD.org>2006-10-25 21:23:20 +0000
commit9ee884309956e31ebd38e59c05c2cb73e86bce4a (patch)
treef6c6b5b543d05a4ecc5ec676ac5fa8445836be4d /usr.bin
parent012f0cc57669f7db3972dca8c9adda00521a5305 (diff)
downloadFreeBSD-src-9ee884309956e31ebd38e59c05c2cb73e86bce4a.zip
FreeBSD-src-9ee884309956e31ebd38e59c05c2cb73e86bce4a.tar.gz
Fix a bug converting a variable from the numeric type to a string.
PR: bin/104795 MFC after: 3 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/awk/Makefile2
-rw-r--r--usr.bin/awk/tran.c.diff22
2 files changed, 23 insertions, 1 deletions
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile
index 7ca3c73..3cd4aa8 100644
--- a/usr.bin/awk/Makefile
+++ b/usr.bin/awk/Makefile
@@ -29,7 +29,7 @@ CLEANFILES+= nawk.1
nawk.1: awk.1
cat ${.ALLSRC} > ${.TARGET}
-.for f in b.c lib.c main.c run.c
+.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}
diff --git a/usr.bin/awk/tran.c.diff b/usr.bin/awk/tran.c.diff
new file mode 100644
index 0000000..18f0f58
--- /dev/null
+++ b/usr.bin/awk/tran.c.diff
@@ -0,0 +1,22 @@
+$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) );
OpenPOWER on IntegriCloud