Module Name: src
Committed By: drochner
Date: Thu Jan 20 21:26:20 UTC 2011
Modified Files:
src/external/historical/nawk/dist: tran.c
Log Message:
fix bug introduced in rev. 1.3: need to set the string before
converting it into a numerical value, otherwise we might get junk or crash
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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/dist/tran.c
diff -u src/external/historical/nawk/dist/tran.c:1.3 src/external/historical/nawk/dist/tran.c:1.4
--- src/external/historical/nawk/dist/tran.c:1.3 Sun Nov 7 22:55:26 2010
+++ src/external/historical/nawk/dist/tran.c Thu Jan 20 21:26:20 2011
@@ -353,6 +353,7 @@
dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n",
vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) );
+ vp->sval = t;
if (&vp->fval == NF) {
donerec = 0; /* mark $0 invalid */
f = getfval(vp);
@@ -360,7 +361,7 @@
dprintf( ("setting NF to %g\n", f) );
}
- return(vp->sval = t);
+ return(vp->sval);
}
Awkfloat getfval(Cell *vp) /* get float val of a Cell */