Aittvax.140 net.4bsd-bugs utzoo!decvax!ittvax!swatt Wed Nov 25 13:56:59 1981 awk I goofed the last time on this; I forgot news quits on the first input line starting with '.'. Again: Wed Nov 25 13:19:47 EST 1981 (reported by cox) [ ] The following script causes awk to core dump with a bus error: --------------------------------- # attempt to produce awk core dump { print $0 >data0 } --------------------------------- The fix is: --------------------------------- cp /usr/src/cmd/awk/run.c /tmp/upd.$$.tmp ; chmod +w /tmp/upd.$$.tmp ed - /tmp/upd.$$.tmp <<\!xxFUNNYxx 848c if (files[i].fp && strcmp(x.optr->sval, files[i].fname) == 0) . 846a /* changed to check for "files[i].fp != 0" in addition to * the string compare, as "fprintf(0, ...)" causes bus * errors. */ . w q !xxFUNNYxx diff /usr/src/cmd/awk/run.c /tmp/upd.$$.tmp >/tmp/upd.$$.dif if cmp - /tmp/upd.$$.dif <<\!xxFUNNYxx 846a847,850 > /* changed to check for "files[i].fp != 0" in addition to > * the string compare, as "fprintf(0, ...)" causes bus > * errors. > */ 848c852 < if (strcmp(x.optr->sval, files[i].fname) == 0) --- > if (files[i].fp && strcmp(x.optr->sval, files[i].fname) == 0) !xxFUNNYxx then : 'compare equal, ok' rm -f run.c cp /tmp/upd.$$.tmp run.c ; chmod a-w run.c else echo "Old source file not same version; use diff listings by hand" fi rm -f /tmp/upd.$$.tmp /tmp/upd.$$.dif ---------------------------------