syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most cases as "C source" instead of as "C program". Nano's magic strings for some other files didn't match any more what file-5.32 currently produces, either. So, they have been adjusted, new ones added, and old ones deleted. This fixes https://savannah.gnu.org/bugs/?52445.master
parent
11a3bc484c
commit
bacb0f717d
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for assembler.
|
## Here is an example for assembler.
|
||||||
|
|
||||||
syntax "asm" "\.(S|s|asm)$"
|
syntax "asm" "\.(S|s|asm)$"
|
||||||
magic "[Aa]ssembl(y|er)"
|
magic "assembler source"
|
||||||
comment "//"
|
comment "//"
|
||||||
|
|
||||||
color red "\<[A-Z_]{2,}\>"
|
color red "\<[A-Z_]{2,}\>"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for awk.
|
## Here is an example for awk.
|
||||||
|
|
||||||
syntax "awk" "\.awk$"
|
syntax "awk" "\.awk$"
|
||||||
magic "awk.*script text"
|
magic "awk script"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
# Records.
|
# Records.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for C/C++.
|
## Here is an example for C/C++.
|
||||||
|
|
||||||
syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
|
syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
|
||||||
magic "(ASCII|UTF-8 Unicode) C(\+\+)? program text"
|
magic "^(C|C\+\+) (source|program)"
|
||||||
comment "//"
|
comment "//"
|
||||||
|
|
||||||
# Constants.
|
# Constants.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Here is an example for Emacs Lisp.
|
## Here is an example for Emacs Lisp.
|
||||||
|
|
||||||
syntax "elisp" "\.el$"
|
syntax "elisp" "\.el$"
|
||||||
|
magic "Lisp/Scheme program"
|
||||||
comment ";"
|
comment ";"
|
||||||
|
|
||||||
# Basic functions/macros
|
# Basic functions/macros
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
syntax "guile" "\.scm$"
|
syntax "guile" "\.scm$"
|
||||||
header "^#!.*guile"
|
header "^#!.*guile"
|
||||||
magic "guile"
|
|
||||||
comment ";"
|
comment ";"
|
||||||
|
|
||||||
# Basic scheme functions
|
# Basic scheme functions
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for HTML.
|
## Here is an example for HTML.
|
||||||
|
|
||||||
syntax "html" "\.html?$"
|
syntax "html" "\.html?$"
|
||||||
magic "HTML document text"
|
magic "HTML document"
|
||||||
comment "<!--|-->"
|
comment "<!--|-->"
|
||||||
|
|
||||||
# Tags:
|
# Tags:
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
## Version: 2011-05-05
|
## Version: 2011-05-05
|
||||||
|
|
||||||
syntax "lua" "\.lua$"
|
syntax "lua" "\.lua$"
|
||||||
|
magic "Lua script"
|
||||||
comment "--"
|
comment "--"
|
||||||
|
|
||||||
color brightwhite "\[\[.*\]\]"
|
color brightwhite "\[\[.*\]\]"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Here is an example for Makefiles.
|
## Here is an example for Makefiles.
|
||||||
|
|
||||||
syntax "makefile" "Makefile[^/]*$" "\.(make|mk)$"
|
syntax "makefile" "Makefile[^/]*$" "\.(make|mk)$"
|
||||||
|
magic "makefile script"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
color red "[:=]"
|
color red "[:=]"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for manpages.
|
## Here is an example for manpages.
|
||||||
|
|
||||||
syntax "man" "\.[1-9]x?$"
|
syntax "man" "\.[1-9]x?$"
|
||||||
magic "troff or preprocessor input text"
|
magic "troff or preprocessor input"
|
||||||
comment ".\""
|
comment ".\""
|
||||||
|
|
||||||
color green "\.(SH|SS|TH) .*$"
|
color green "\.(SH|SS|TH) .*$"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Here is an example for C/C++/Obj-C.
|
## Here is an example for C/C++/Obj-C.
|
||||||
|
|
||||||
syntax "m" "\.m$"
|
syntax "m" "\.m$"
|
||||||
|
magic "Objective-C source"
|
||||||
comment "//"
|
comment "//"
|
||||||
|
|
||||||
# Stuffs,
|
# Stuffs,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Syntax highlighting for OCaml.
|
## Syntax highlighting for OCaml.
|
||||||
|
|
||||||
syntax "ocaml" "\.mli?$"
|
syntax "ocaml" "\.mli?$"
|
||||||
|
magic "OCaml"
|
||||||
comment "(*|*)"
|
comment "(*|*)"
|
||||||
|
|
||||||
# Uid:
|
# Uid:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for patch files.
|
## Here is an example for patch files.
|
||||||
|
|
||||||
syntax "patch" "\.(patch|diff|debdiff)$"
|
syntax "patch" "\.(patch|diff|debdiff)$"
|
||||||
magic "diff output text"
|
magic "diff output"
|
||||||
# There is no official support for comments in patch files.
|
# There is no official support for comments in patch files.
|
||||||
comment ""
|
comment ""
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
syntax "perl" "\.p[lm]$"
|
syntax "perl" "\.p[lm]$"
|
||||||
header "^#!.*perl[-0-9._]*"
|
header "^#!.*perl[-0-9._]*"
|
||||||
magic "Perl script text"
|
magic "Perl script"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Here is an example for PHP.
|
## Here is an example for PHP.
|
||||||
|
|
||||||
syntax "php" "\.ph(p[23457s~]?|tml)$"
|
syntax "php" "\.ph(p[23457s~]?|tml)$"
|
||||||
magic "PHP script text"
|
magic "PHP script"
|
||||||
comment "//"
|
comment "//"
|
||||||
|
|
||||||
# PHP markings.
|
# PHP markings.
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
## Here is an example for PostgreSQL.
|
## Here is an example for PostgreSQL.
|
||||||
|
|
||||||
syntax "sql" "\.sql[2345s~]?$"
|
syntax "sql" "\.sql[2345s~]?$"
|
||||||
magic "PostgreSQL script text"
|
|
||||||
comment "-- "
|
comment "-- "
|
||||||
|
|
||||||
# Functions.
|
# Functions.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
syntax "python" "\.py$"
|
syntax "python" "\.py$"
|
||||||
header "^#!.*python[-0-9._]*"
|
header "^#!.*python[-0-9._]*"
|
||||||
|
magic "Python script"
|
||||||
linter pyflakes
|
linter pyflakes
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
syntax "ruby" "\.rb$"
|
syntax "ruby" "\.rb$"
|
||||||
header "^#!.*ruby[-0-9._]*"
|
header "^#!.*ruby[-0-9._]*"
|
||||||
|
magic "Ruby script"
|
||||||
linter ruby -w -c
|
linter ruby -w -c
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
syntax "sh" "\.sh$"
|
syntax "sh" "\.sh$"
|
||||||
header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
|
header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
|
||||||
magic "(POSIX|Bourne.*) shell script text"
|
magic "(POSIX|Bourne-Again) shell script.*text"
|
||||||
linter dash -n
|
linter dash -n
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Syntax highlighting for Tcl files.
|
## Syntax highlighting for Tcl files.
|
||||||
|
|
||||||
syntax "tcl" "\.tcl$"
|
syntax "tcl" "\.tcl$"
|
||||||
|
magic "Tcl(/Tk)? script"
|
||||||
comment "#"
|
comment "#"
|
||||||
|
|
||||||
# Standard Tcl [info commands]:
|
# Standard Tcl [info commands]:
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
## Here is a short example for TeX files.
|
## Here is a short example for TeX files.
|
||||||
|
|
||||||
syntax "tex" "\.tex$"
|
syntax "tex" "\.tex$"
|
||||||
|
magic "(La)?TeX document"
|
||||||
linter chktex -v0 -q -I
|
linter chktex -v0 -q -I
|
||||||
comment "%"
|
comment "%"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
syntax "texinfo" "\.texi$"
|
syntax "texinfo" "\.texi$"
|
||||||
header "^\\input texinfo"
|
header "^\\input texinfo"
|
||||||
magic "Texinfo source text"
|
magic "Texinfo source"
|
||||||
comment "@c "
|
comment "@c "
|
||||||
|
|
||||||
# Command arguments, trailing and enclosed.
|
# Command arguments, trailing and enclosed.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$"
|
syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$"
|
||||||
header "<\?xml.*version=.*\?>"
|
header "<\?xml.*version=.*\?>"
|
||||||
magic "(XML|SGML) (sub)?document text"
|
magic "(XML|SGML) (sub)?document"
|
||||||
comment "<!--|-->"
|
comment "<!--|-->"
|
||||||
|
|
||||||
# The entire content of the tag:
|
# The entire content of the tag:
|
||||||
|
|
Loading…
Reference in New Issue