bugGNU nano - Bugs: bug #61308, upon returning from history, nano...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61308: upon returning from history, nano will resurrect a deleted answer

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Fri 08 Oct 2021 09:21:12 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Open

Sat 09 Oct 2021 08:16:59 AM UTC, comment #1: 

Fixed in git, commit ca2911b, by setting 'magichistory' always when typing the first <Up>/^P.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 08 Oct 2021 09:21:12 AM UTC, original submission:  

To reproduce, run 'src/nano --ignore'.
Then type: ^W aaa <Enter> ^W bbb <Up> <Down>
See that after the little excursion to the previous search string with <Up>, the <Down> shows the "bbb" again that you typed at the prompt.  This is correct.

Now type: ^K <Up> <Down>
See that, even though you deleted the "bbb" with ^K, nano puts the string back after the the little excursion into history.  This is wrong.

Now type: <Bsp> <Up> <Down>
See that the "bb" is correctly restored.

Type again: <Bsp> <Up> <Down>
See that the "b" is correctly restored.

And again type: <Bsp> <Up> <Down>
See that "b" is wrongly resurrected.

Bug exists since at least version 2.1.10.  Bug was found by code inspection.

The problem is that 'magichistory' gets set only when 'answer' is a non-empty string.  It should instead set 'magichistory' always, also when 'answer' is empty -- that is: when the user typed nothing, or when the user deleted what they typed earlier.  This causes some stupid copying of an empty string in /most/ cases that the user goes into history, but it is the correct thing to do.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-09 bens StatusNone => Fixed

    Back to the top


    Powered by Savane 3.7