Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 SMI; site sun.uucp Path: utzoo!linus!security!genrad!decvax!decwrl!sun!shannon From: shannon@sun.uucp (Bill Shannon) Newsgroups: net.bugs.4bsd Subject: 4.2bsd awk bug Message-ID: <378@sun.uucp> Date: Fri, 9-Dec-83 04:29:39 EST Article-I.D.: sun.378 Posted: Fri Dec 9 04:29:39 1983 Date-Received: Sun, 11-Dec-83 00:36:57 EST Organization: Sun Microsystems, Inc. Lines: 30 Index: bin/awk 4.2BSD [Fix] Description: Awk doesn't allow you to replace fields. This bug was introduced when the indirect-through-zero bugs in awk were fixed. Repeat-By: The following command echo 1 2 3 | awk '{$1 = NF; print}' should give 3 2 3 if it works. If it's broken it will give 1 2 3 Fix: Install the following fix: --- awk.def 7a8 > #define isnull(x) ((x) == EMPTY || (x) == NULL) --- tran.c 139c139 < if ((vp->tval & FLD) && vp->nval == 0) --- > if ((vp->tval & FLD) && isnull(vp->nval)) 154c154 < if ((vp->tval & FLD) && vp->nval == 0) --- > if ((vp->tval & FLD) && isnull(vp->nval))