From: Reuben Thomas Date: Tue, 7 Jun 2016 23:28:37 +0000 (+0000) Subject: perl: re-strengthen hash-bang patterns X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d63b501a118fd20f4c8f2f4634b25d50954c9f3;p=file perl: re-strengthen hash-bang patterns They were being out-matched by the catch-all varied.script patterns, and thus losing their MIME types. hash-bang patterns have to be at the very start of the file, so don’t need the leeway that the other patterns have been given. --- diff --git a/magic/Magdir/perl b/magic/Magdir/perl index 127a3739..099a22d1 100644 --- a/magic/Magdir/perl +++ b/magic/Magdir/perl @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: perl,v 1.24 2015/03/27 17:58:58 christos Exp $ +# $File: perl,v 1.25 2016/06/07 23:28:37 rrt Exp $ # perl: file(1) magic for Larry Wall's perl language. # # The `eval' lines recognizes an outrageously clever hack. @@ -23,11 +23,11 @@ !:mime text/x-perl 0 search/1024 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text !:mime text/x-perl -0 search/1024 #!/usr/bin/env\ perl Perl script text executable +0 string #!/usr/bin/env\ perl Perl script text executable !:mime text/x-perl -0 search/1024 #!\ /usr/bin/env\ perl Perl script text executable +0 string #!\ /usr/bin/env\ perl Perl script text executable !:mime text/x-perl -0 search/1024 #! +0 string #! >0 regex \^#!.*/bin/perl([[:space:]].*)*$ Perl script text executable !:mime text/x-perl