bugGNU nano - Bugs: bug #47292, the magic command accepts a lone...

 
 

bug #47292: the magic command accepts a lone quote

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 28 Feb 2016 10:03:37 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.

 

Sun 28 Feb 2016 04:56:12 PM UTC, comment #1:

Fixed in SVN, r5692 -- both the lone quote and the intermediate junk.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 28 Feb 2016 10:03:37 AM UTC, original submission:

When adding the following line to a syntax definition:

magic "

nano will accept this without protest and will add an empty regex string -- meaning that this syntax will match /any/ file.

Specifying a single doublequote after the header command will make nano complain about needing enclosing quotes, and will not add any header regex.

As already noted in bug #47289 (but that was with the patch already applied), currently the magic command accepts junk between different regexes. The header command currently does not.

Also, magic, header, and extension regexes are currently allowed to be an empty string, which will match anything. I think nano shouldn't accept such an empty string -- if the user wants to match /every/ file, she should be a bit more explicit, like with ".*". But... maybe a few users already use this "" to switch off all syntax coloring (syntax "all" ""), so maybe we better keep accepting an empty string.

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 09:44:18 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 28 Feb 2016 04:56:12 PM UTCbensStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1