[comp.os.minix] Bug report on ed

kb@umnstat.UUCP (Christopher Bingham) (03/24/88)

I found a disturbing apparent bug in a version of ed that was recently
distributed as part of a PC version of patch on comp.binaries.ibm.pc.  The
source for the ed included was said to have been posted to comp.os.minix a few
weeks ago.  I don't know whether it includes any subsequent bug fixes and I
do not have the source.

I did the following on the README file from pcpatch.arc

B> ed readme
g/[cC]om[pP]/p
g//s//xxxx/p

The 1st command should print out all lines containing comp, comP, Comp, or ComP.
Instead it printed out lines 5, 16, 20, 21, 23, 24, and 28 containing,
respectively, "compares" (ok), "compiled" (ok), "commands" (not ok), "commands"
(not ok), "become" (not ok), "command" (not ok), and "compatible" (ok).

The second command then printed out the same lines with the indicated words
changed to "xxxxares", "xxxxiled", "xxxxands", "xxxxands", "bexxxx", "xxxxand",
and "xxxxatible".  Something is apparently wrong with the regular expression
parser.

Also ed did not recognize the command "q" or "q!" .

I do not subscribe to this group so any response should be by email.

C. Bingham, Applied Statistics, U of Minnesota, St. Paul, MN
kb@umnstat.stat.umn.edu
kb%umnstat@umn-cs.cs.umn.edu
...!ihnp4!umn-cs!umnstat!kb