diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-30 01:52:49 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-30 01:52:49 +0000 |
commit | 92f3150912b4d375df827a15d8e929575c71c014 (patch) | |
tree | f638bbe716809fd27621b25c2813a1e9478a88bc /usr.bin/awk/tran.c | |
parent | 0f3aec300d9d954add1864f9c69be31ab4f02569 (diff) |
Update to version 20041222; OK deraadt@
Diffstat (limited to 'usr.bin/awk/tran.c')
-rw-r--r-- | usr.bin/awk/tran.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c index 170fe76d0fa..691b411f6b8 100644 --- a/usr.bin/awk/tran.c +++ b/usr.bin/awk/tran.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tran.c,v 1.10 2003/04/06 06:12:01 pvalchev Exp $ */ +/* $OpenBSD: tran.c,v 1.11 2004/12/30 01:52:48 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -52,6 +52,7 @@ char **SUBSEP; /* subscript separator for a[i,j,k]; default \034 */ Awkfloat *RSTART; /* start of re matched with ~; origin 1 (!) */ Awkfloat *RLENGTH; /* length of same */ +Cell *fsloc; /* FS */ Cell *nrloc; /* NR */ Cell *nfloc; /* NF */ Cell *fnrloc; /* FNR */ @@ -74,7 +75,8 @@ void syminit(void) /* initialize symbol table with builtin vars */ nullloc = setsymtab("$zero&null", "", 0.0, NUM|STR|CON|DONTFREE, symtab); nullnode = celltonode(nullloc, CCON); - FS = &setsymtab("FS", " ", 0.0, STR|DONTFREE, symtab)->sval; + fsloc = setsymtab("FS", " ", 0.0, STR|DONTFREE, symtab); + FS = &fsloc->sval; RS = &setsymtab("RS", "\n", 0.0, STR|DONTFREE, symtab)->sval; OFS = &setsymtab("OFS", " ", 0.0, STR|DONTFREE, symtab)->sval; ORS = &setsymtab("ORS", "\n", 0.0, STR|DONTFREE, symtab)->sval; @@ -316,7 +318,8 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ char *t; int fldno; - dprintf( ("starting setsval %p: %s = \"%s\", t=%o\n", vp, NN(vp->nval), s, vp->tval) ); + dprintf( ("starting setsval %p: %s = \"%s\", t=%o, r,f=%d,%d\n", + vp, NN(vp->nval), s, vp->tval, donerec, donefld) ); if ((vp->tval & (NUM | STR)) == 0) funnyvar(vp, "assign to"); if (isfld(vp)) { @@ -335,7 +338,8 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~DONTFREE; - dprintf( ("setsval %p: %s = \"%s (%p)\", t=%o\n", vp, NN(vp->nval), t,t, vp->tval) ); + dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", + vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); return(vp->sval = t); } @@ -356,8 +360,7 @@ Awkfloat getfval(Cell *vp) /* get float val of a Cell */ return(vp->fval); } - static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cell */ - +static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cell */ { char s[100]; /* BUG: unchecked */ double dtemp; |