bug-ed
[Top][All Lists]
Advanced

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

Re: [Bug-ed] GNU ed 1.14-pre1 released


From: Ori Avtalion
Subject: Re: [Bug-ed] GNU ed 1.14-pre1 released
Date: Thu, 21 Apr 2016 22:31:55 +0300

> It seems that the current line number shall be set to zero only if no lines
> remain in the buffer.
>
> Moreover, the description of the i command states that "This command differs
> from the a command only in the placement of the input text". So you may be
> right that the current address should be 1 in both cases.

You may be right and I'm being paranoid :)
Quoting POSIX's RATIONALE section:

  "For consistency with the a and r commands and better user functionality,
   the i and c commands must also accept an address of 0,
   in which case 0i is treated as 1i and likewise for the c command."

So these command should behave as if the addressed line was 1 for all
intents and purposes,
*including* setting the final address in case of empty input.

On Thu, Apr 21, 2016 at 10:17 PM, Antonio Diaz Diaz <address@hidden> wrote:
> Ori Avtalion wrote:
>>>
>>> According to the POSIX spec, it should be interpreted as 1:
>>>   "the current line is set to the last inserted line or, if there was
>>> none, to the addressed line.
>>>    [..]
>>>   Address 0 shall be valid for this command; it shall be interpreted
>>> as if address 1 were specified."
>>
>> [..]
>>>
>>> However, I think the spirit of the text does suggest that the current
>>> address should be 1. :)
>>
>>
>> That said, the descriptions for Change and Delete explicitly state "the
>> current
>> line number shall be set to zero" in some situations, so perhaps if an
>> explicit
>> address of 0 is given as input, it should be "interpreted as 1" for the
>> purpose
>> of Insert, but kept at 0 if no input was provided.
>
>
> It seems that the current line number shall be set to zero only if no lines
> remain in the buffer.
>
> Moreover, the description of the i command states that "This command differs
> from the a command only in the placement of the input text". So you may be
> right that the current address should be 1 in both cases.
>
>
> Best regards,
> Antonio.



reply via email to

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