nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Alert on unknown file: magic_file(...) failed: line 156: re


From: Michal Nowak
Subject: [Nano-devel] Alert on unknown file: magic_file(...) failed: line 156: regex error 10
Date: Tue, 26 Mar 2019 07:04:28 +0100

Hi,

I work on updating GNU nano to 4.0 on OpenIndiana (illumos kernel). When there's no suitable syntax highlighting file, there's an alert in nano like

$ nano 2019-03-14-07-13-49.050-VBoxSVC-6791.log
[ magic_file(2019-03-14-07-13-49.050-VBoxSVC-6791.log) failed: line 156: regex error 10 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid character range) ]

This is the content of the file:

Log created: 2019-03-14T07:13:49.501613000Z
Executable: /opt/VirtualBox/amd64/VBoxSVC
Arg[0]: /opt/VirtualBox/amd64/VBoxSVC
Arg[1]: --auto-shutdown
AddRef: illegal refcnt=3221225469 state=2

This is how file v5.36 identifies the file

$ gfile 2019-03-14-07-13-49.050-VBoxSVC-6791.log
2019-03-14-07-13-49.050-VBoxSVC-6791.log: ASCII text

The only content in /etc/nanorc is

include "/usr/share/nano/*.nanorc"

With file "Makefile" file I see the highlighting as working, no alert:

$ gfile Makefile
Makefile: makefile script, ASCII text

So far, the alert seems not a very useful one to me, so I intend to disable it on our side:

--- nano-4.0/src/color.c        2019-03-23 09:26:13.000000000 +0000
+++ nano-4.0/src/color.c.new    2019-03-25 22:28:50.179629357 +0000
@@ -240,9 +240,9 @@ void color_update(void)
                                statusline(ALERT, _("magic_load() failed: %s"), 
strerror(errno));
                        else {
                                magicstring = magic_file(cookie, 
openfile->filename);
-                               if (magicstring == NULL)
-                                       statusline(ALERT, _("magic_file(%s) failed: 
%s"),
-                                                               
openfile->filename, magic_error(cookie));
+                               //if (magicstring == NULL)
+                               //      statusline(ALERT, _("magic_file(%s) failed: 
%s"),
+                               //                              
openfile->filename, magic_error(cookie));
                        }
                }


Is there a better way to deal with files which might not have syntax highlighting file?

Thanks,
Michal

PS: Keep me cc-ed, please, as I am not subscribed to the mailing list.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]