bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] fc: trim range instead of erroring out


From: Chet Ramey
Subject: Re: [PATCH] fc: trim range instead of erroring out
Date: Thu, 20 Aug 2020 11:43:09 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 8/20/20 9:08 AM, Martijn Dekker wrote:
> Op 12-08-20 om 16:40 schreef Chet Ramey:
>> What's your opinion about what the `as appropriate' means? An out-of-range
>> `first' gets substituted with the first command in the history, and an out-
>> of-range `last' gets the last history entry?
> 
> Yes, that was my intention.

OK. That was my question, since that doesn't seem to happen. With your
patch (and even before), for instance, consider the following commands
on an empty history:

echo a
echo b
fc -l
fc -l 1002 1100

The first `fc' will list the echo commands. The second `fc' will list the
last command in the history, since both numbers are clamped at the end of
the history -- the range ends up being `last-last'.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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