=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/awk/lib.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/awk/lib.c 2017/12/08 17:04:15 1.25 --- src/usr.bin/awk/lib.c 2020/06/10 21:00:01 1.26 *************** *** 1,4 **** ! /* $OpenBSD: lib.c,v 1.25 2017/12/08 17:04:15 deraadt Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved --- 1,4 ---- ! /* $OpenBSD: lib.c,v 1.26 2020/06/10 21:00:01 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved *************** *** 359,364 **** --- 359,365 ---- } } setfval(nfloc, (Awkfloat) lastfld); + donerec = 1; /* restore */ if (dbg) { for (j = 0; j <= lastfld; j++) { p = fldtab[j]; *************** *** 388,393 **** --- 389,407 ---- cleanfld(lastfld+1, n); lastfld = n; setfval(nfloc, (Awkfloat) n); + } + + void setlastfld(int n) /* set lastfld cleaning fldtab cells if necessary */ + { + if (n > nfields) + growfldtab(n); + + if (lastfld < n) + cleanfld(lastfld+1, n); + else + cleanfld(n+1, lastfld); + + lastfld = n; } Cell *fieldadr(int n) /* get nth field */