bugGNU nano - Bugs: bug #52445, magic does not work

 
 

bug #52445: magic does not work

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 19 Nov 2017 08:42:04 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 19 Nov 2017 10:27:34 AM UTC, comment #1:

Fixed in git, bacb0f71.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 19 Nov 2017 08:42:04 AM UTC, original submission:

To reproduce, compile nano without disabling libmagic. Then copy src/text.c to ceetext. Then run:

src/nano ceetext

Nano does not recognize the file as C and falls back to the default syntax. But if you run:

file --brief ceetext

the result is:

C source, ASCII text

So libmagic does recognize the file as being C. The thing is, with file-5.10 libmagic stopped identifying C files as "C program" and identified them as "C source" instead. :| The identifying strings for several other files changed as well, I imagine (I haven't checked beyond C and C++), breaking nano's magic. So... for the past three, four years, on production systems, nano's magic hasn't been working. :|

It almost makes me decide to chuck the magic stuff entirely. First, because it is very rarely needed (file extensions and header lines work in most cases). And second, no one noticed that it isn't working (not for C files, at least), so it doesn't seem that anyone uses it or relies on it.

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
    Tue 28 Nov 2017 08:12:04 PM UTCbensOpen/ClosedOpen=>Closed
    Sun 19 Nov 2017 10:27:34 AM UTCbensStatusIn Progress=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1