bugGNU nano - Bugs: bug #57950, when end= is absent, the start=...

 
 

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

bug #57950: when end= is absent, the start= regex is stored anyway

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 03 Mar 2020 06:15:08 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Wed 04 Mar 2020 03:47:57 PM UTC, comment #4: 

Now actually fixed, commit d675a549.

Benno Schulenberg <bens>
Group administrator
Wed 04 Mar 2020 08:26:57 AM UTC, comment #3: 

Of course, the reproduction recipe should have been: put the following two lines into a new file called 'testrc':


syntax test ".*"
color yellow start="\S"


Then run 'src/nano --rcfile=testrc NEWS', and see that everything is colored.

Benno Schulenberg <bens>
Group administrator
Wed 04 Mar 2020 08:21:28 AM UTC, comment #2: 

No, it's not fixed.  :|  When end= is missing, the parse_rule() routine happily returns and leaves the 'newcolor' thing in place.  What's worse, when the end= regex is invalid, the'newcolor' data is freed but the element stays linked into the list of rules.  :|

Benno Schulenberg <bens>
Group administrator
Tue 03 Mar 2020 06:53:22 PM UTC, comment #1: 

Fixed in git, commit 365058c4.

Benno Schulenberg <bens>
Group administrator
Tue 03 Mar 2020 06:15:08 PM UTC, original submission:  

To reproduce, put the following two lines in your nanorc:

syntax "test"
color blue start="x"


Then run 'src/nano -Ytest ~/.nanorc'.
Nano complains that «"start=" requires a corresponding "end="», but the start expression is still stored as a lone expression, coloring any "x", as can be seen in the x of "syntax".

Expected behavior: whenever a start=/end= pair is incomplete, no rule at all should be stored for the corresponding regexes.

(Buglet was found by code inspection.)

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

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-04 bens StatusIn Progress Fixed
    2020-03-04 bens StatusFixed In Progress
    2020-03-03 bens Summarywhen end= is absent, the start= is stored anyway when end= is absent, the start= regex is stored anyway
    2020-03-03 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code