bugGNU nano - Bugs: bug #48635, replacing with a start-of-line...

 
 

bug #48635: replacing with a start-of-line anchor should happen just once

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 26 Jul 2016 11:55:06 AM UTC  
 
Severity: 3 - NormalStatus: 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.

 

Thu 26 Jan 2017 04:47:42 PM UTC, comment #5:

Refixed in git, ef7a7c53.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 24 Jan 2017 01:45:35 PM UTC, comment #4:

The reproduction recipe has become this: run 'src/nano --ignore +44 README.GIT', then type:

M-R M-R ^ <Space> <Enter> <Enter> A

Currently it replaces 36 occurrences. It should replace just 9.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 23 Jan 2017 08:55:25 PM UTC, comment #3:

The offending commit is the same: c88d7ce5. Version 2.7.4 is still okay.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 23 Jan 2017 08:46:37 PM UTC, comment #2:

The bug has resurfaced. (See also bug #50126.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 27 Jul 2016 07:29:01 AM UTC, comment #1:

Fixed in git, c88fae3.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 26 Jul 2016 11:55:06 AM UTC, original submission:

When one tries to replace a regex that includes the start-of-line anchor, nano repeatedly runs this replacement on the same line, until it fails, instead of just once. So, if one tries to replace "^x", it acts as if one specified "^x*".

To reproduce, run 'src/nano +1 README' and type:
M-R M-R ^ <Space> <Enter> <Enter> A
Notice how all leading spaces get snipped.

Expected behavior: a replacement of "^x" should happen just once per line, like in other editors.

See also https://lists.gnu.org/archive/html/nano-devel/2016-07/msg00054.html.

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 26 Jan 2017 04:48:39 PM UTCbensOpen/ClosedOpen=>Closed
    Thu 26 Jan 2017 04:47:42 PM UTCbensStatusConfirmed=>Fixed
    Mon 23 Jan 2017 08:46:37 PM UTCbensStatusFixed=>Confirmed
      Open/ClosedClosed=>Open
    Sat 30 Jul 2016 09:25:32 AM UTCbensOpen/ClosedOpen=>Closed
    Wed 27 Jul 2016 07:29:01 AM UTCbensStatusNone=>Fixed
      Assigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1