bugGNU nano - Bugs: bug #57931, filtering an empty region filters...

 
 

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

bug #57931: filtering an empty region filters the whole buffer

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 01 Mar 2020 02:53:33 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Mon 02 Mar 2020 12:43:00 PM UTC, comment #3: 

Fixed in git, commit 477a9b33.

Benno Schulenberg <bens>
Group administrator
Mon 02 Mar 2020 12:32:04 PM UTC, comment #2: 

No additional variable is needed.  The send_data() routines should always simply send what is in the cutbuffer.  This will be either the previously marked region (whether or not it was zero characters) or the entire previous contents of the buffer.  That is exactly what is needed.

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 06:58:45 PM UTC, comment #1: 

The problem is that the call of send_data() checks for 'cutbuffer != NULL'.  But the cutbuffer may also be NULL when zero characters were marked.  :|  An additional variable is needed to remember whether the mark was set.

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 02:53:33 PM UTC, original submission:  

To reproduce, run 'src/nano --ignore +44 README'.
Then first type: ^6 ^O xxx <Enter>.
Note that nano wrote zero lines: it created an empty file.
Type ^6 to turn the mark off.

Now type: ^6 ^R ^X |grep Pico <Enter>.
Note that four lines are inserted.  Apparently nano pipes the whole buffer to the executed command when the mark covers zero characters.  This is unexpected.

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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-02 bens StatusIn Progress Fixed
    2020-03-01 bens StatusNone In Progress
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code