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

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

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>
Group administrator
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>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-16 bens Open/ClosedOpen Closed
    2021-10-09 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code