Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!mcvax!unido!ecrcvax!diomidis From: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Newsgroups: comp.bugs.4bsd Subject: Re: `t' command of sed does not work fine. Keywords: sed fix branch t Message-ID: <760@ecrcvax.UUCP> Date: 23 Aug 89 10:44:54 GMT References: <2427@srava.sra.JUNET> Reply-To: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Organization: ECRC, Munich 81, West Germany Lines: 75 In article <2427@srava.sra.JUNET> katsu@sra.JUNET (Katsuhiro Watanabe) writes: > > Hello, world. I am using 4.3BSD on VAX. > I found a bug on sed of BSDs, so I would like to report it. > > Even if no substitution have been made before `t'(since >the most recent reading of and input line), it often branches. > > [...] > > Is this known yet? I sent a bug report and fix to 4bsd-bugs@BERKELEY.EDU on May 18th 1989. The acknowledgement from CSRG gave it ``bulk'' precedence. Here is the report and fix: Subject: Sed does not clear the flag used by `t' when reading new input Index: bin/sed 4.3BSD Description: According to the sed manual page the test command `t' branches to the : command bearing the label specified if any substitutions have been made since the most recent reading of an input line or execution of a `t'. In the 4.3BSD version of sed the reading of an input line does not cancel the effect of substitutions made before reading the new line. Thus if any of those substitutions succeded the first `t' to be executed will succeeed even if a new input line has been read. Repeat-By: Execute the following: sed -e ' s/hello/goodbye/ /goodbye/d t n a\ t failed b : n a\ t succeeded' <