bugGNU nano - Bugs: bug #48157, cutting stuff after undoing (when...

 
 

bug #48157: cutting stuff after undoing (when the mark is on the current line) produces random data

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 07 Jun 2016 08:02:08 AM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 08 Jun 2016 08:05:48 AM UTC, comment #1:

Fixed in git, ccffc54.

The bug was old, since at least nano-2.2.1 (compounded by other bugs).

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 07 Jun 2016 08:02:08 AM UTC, original submission:

To reproduce, run 'src/nano --ignore' and type:
xxx M-A <Home> ooo M-U ^K

Result: �����^G!

That is with MALLOC_PERTURB_=221. With MALLOC_PERTURB_ unset, a single random byte is produce.

This is related to bug #48108.

The problem is that the normal action routines have code to adjust the mark (when it is on the same line or nearby), but the undo routines have no such code.

One solution would be to add that code, but that looks like a big undertaking... :| So, easiest solution is to always unset the mark as soon as an undo or redo is executed. (Undoing a file insertion already unsets the mark, so in a way this also makes things more consistent.)

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

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 Jun 2016 10:17:45 AM UTCbensOpen/ClosedOpen=>Closed
    Wed 08 Jun 2016 08:05:48 AM UTCbensStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1