History numbering is now off-by-one due to some recent change

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

History numbering is now off-by-one due to some recent change

In current cvs (5.1) the numbering shown by the "history" command
is off by one, in the sense that trying to retrieve a command by number
results in execution of the command immediately prior to the one equested.

I think this is because of a change to history.c (write_history_list) on 20 June.
The corresponding entry in ChangeLog seems to be

2016-06-20  Bastian Maerkisch  <[hidden email]>
        * src/readline.c (write_history_list):  Avoid adding extra leading
        spaces when saving to a file.  Index of history_get is zero-based
        relative to history_base.

although it does not mention a change to history.c.

Can someone (Bastian?) clarify whether that change was a fix for
a real problem?  If not I think it should be reverted.

On the other hand if it did fix something then a corresponding
change needs to be made in command.c (history_command)
so that the command
   history !<lineno>
retrieves <lineno + 1> instead.

Or something like that.  

Sourceforge is currently down so I can't confirm the change history
or possible reversion.


What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta