Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!bruce!cechew From: cechew@bruce.cs.monash.OZ.AU (Earl Chew) Newsgroups: comp.os.minix Subject: Sed Bug Message-ID: <2759@bruce.cs.monash.OZ.AU> Date: 30 Jul 90 00:13:37 GMT Organization: Monash Uni. Computer Science, Australia Lines: 52 Here is a patch to sed to fix the following problem. I've half-noticed it before, but Bruce Evans managed to pin it down to give wierd example. Earl ------------------------------------------------------------------------------- File: sed.c Problem: The following sed invocation fails: echo a | sed -e 's/a/aa/g' -e ':dummy' producing: aaaa But the following works! echo a | sed -e 's/a/aa/g;:dummy' echo a | sed -e 's/a/aa/g' Fix: cmdline() failed to clear the input buffer so the s-command gets compiled twice. ------------------------------------------------------------------------------- Encoded patch follows: ------------------------------------------------------------------------------- begin 600 sed.c.cdif M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0I&:6QE.@D)2<* M"0EP#H)"6-M9&QI;F4H*2!F86EL M960@=&\@8VQE87(@=&AE(&EN<'5T(&)U9F9E