From a4b3abc4104d8a4eeb84a6242f2f1a830204a539 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Sat, 12 Mar 2022 15:09:47 +0000
Subject: [PATCH] Combine regex's to improve performance adjusting strength to
preserve ranking (Dirk Mueller)
---
magic/Magdir/make | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/magic/Magdir/make b/magic/Magdir/make
index f522b4f18..1abdf7a3e 100644
--- a/magic/Magdir/make
+++ b/magic/Magdir/make
@@ -1,36 +1,21 @@
#------------------------------------------------------------------------------
-# $File: make,v 1.4 2018/05/29 17:26:02 christos Exp $
+# $File: make,v 1.5 2022/03/12 15:09:47 christos Exp $
# make: file(1) magic for makefiles
#
# URL: https://en.wikipedia.org/wiki/Make_(software)
-0 regex/100l \^CFLAGS makefile script text
-!:mime text/x-makefile
-0 regex/100l \^VPATH makefile script text
-!:mime text/x-makefile
-0 regex/100l \^LDFLAGS makefile script text
-!:mime text/x-makefile
-0 regex/100l \^all: makefile script text
-!:mime text/x-makefile
-0 regex/100l \^\\.PRECIOUS makefile script text
+0 regex/100l \^(CFLAGS|VPATH|LDFLAGS|all:|\\.PRECIOUS) makefile script text
!:mime text/x-makefile
+!:strength -15
# Update: Joerg Jenderek
# Reference: https://www.freebsd.org/cgi/man.cgi?make(1)
# exclude grub-core\lib\libgcrypt\mpi\Makefile.am with "#BEGIN_ASM_LIST"
# by additional escaping point character
-0 regex/100l \^\\.BEGIN BSD makefile script text
-!:mime text/x-makefile
-!:ext /mk
-!:strength +10
# exclude MS Windows help file CoNtenT with ":include FOOBAR.CNT"
# and NSIS script with "!include" by additional escaping point character
-0 regex/100l \^\\.include BSD makefile script text
-!:mime text/x-makefile
-!:ext /mk
-!:strength +10
-0 regex/100l \^\\.endif BSD makefile script text
+0 regex/100l \^\\.(BEGIN|endif|include) BSD makefile script text
!:mime text/x-makefile
!:ext /mk
-!:strength +10
-0 regex/100l \^SUBDIRS automake makefile script text
+!:strength -10
+0 regex/100l \^SUBDIRS[[:space:]]+= automake makefile script text
!:mime text/x-makefile
-!:strength +10
+!:strength -15