aboutsummaryrefslogtreecommitdiff
path: root/contrib/file/magic/Magdir/c-lang
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/file/magic/Magdir/c-lang')
-rw-r--r--contrib/file/magic/Magdir/c-lang13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/file/magic/Magdir/c-lang b/contrib/file/magic/Magdir/c-lang
index 9356e82ed9e2..6e375a06a7e6 100644
--- a/contrib/file/magic/Magdir/c-lang
+++ b/contrib/file/magic/Magdir/c-lang
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: c-lang,v 1.28 2019/11/15 21:03:14 christos Exp $
+# $File: c-lang,v 1.32 2023/06/16 19:57:19 christos Exp $
# c-lang: file(1) magic for C and related languages programs
#
# The strength is to beat standard HTML
@@ -17,7 +17,7 @@
>>0 regex \^class[[:space:]]+
>>>&0 regex \\{[\.\*]\\}(;)?$ \b++
>>&0 clear x source text
-!:strength + 13
+!:strength + 15
!:mime text/x-c
0 search/8192 pragma
>0 regex \^#[[:space:]]*pragma C source text
@@ -49,7 +49,10 @@
>0 regex \^union[[:space:]]+ C source text
!:mime text/x-c
0 search/8192 main(
->&0 regex \\)[[:space:]]*\\{ C source text
+>&0 search/64 String Java source text
+!:mime text/x-java
+>&0 default x
+>>&0 regex \\)[[:space:]]*\\{ C source text
!:mime text/x-c
# C++
@@ -85,13 +88,13 @@
!:strength + 30
!:mime text/x-c++
0 search/8192 protected
->0 regex \^[[:space:]]*protected: C++ source text
+>0 regex \^[[:space:]]*protected: C++ source text
!:strength + 30
!:mime text/x-c++
# Objective-C
0 search/8192 #import
->0 regex \^#import Objective-C source text
+>0 regex \^#import[[:space:]]+["<] Objective-C source text
!:strength + 25
!:mime text/x-objective-c