[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ed] Undocumented deviation from POSIX - current line after empty in

From: Ori Avtalion
Subject: [Bug-ed] Undocumented deviation from POSIX - current line after empty insert
Date: Thu, 25 Feb 2016 11:45:35 +0200

Using ed 1.13

The POSIX standard for the Insert command states:

  the current line is set to the last inserted line or, if there was
none, to the addressed line

This goes against all implementations of ed that I can find, which set
the current line to be the inserted line, or, if no input was
provided, at a line before the addressed line.

That is, if I'm on the first line and type:
then the current line is now 0, even though the addressed line was 1.

This is documented vaguely in GNU ed, as it doesn't address the "no
lines entered" edge case:
  "The current address is set to the last line entered"

It's clearer in the Plan 9 docs:
  "Dot is left at the last line input, or, if there were none, at the
line before the addressed line."

If the above is correct:
* Should this be listed as a deviation from POSIX?
* Could the docs be improved to specifically mention the behavior with
empty input? The documentation for Append has a similar issue.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]