Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105,423 changes: 52,722 additions & 52,701 deletions ext/fileinfo/data_file.c

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions ext/fileinfo/magicdata.patch
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,41 @@ index 69e8e90f..76f7e7da 100644
--
2.13.6

From bb421c437d406760fb9f70f49e2eb5c504528450 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Mon, 5 Jun 2017 17:40:31 +0000
Subject: [PATCH] use default to avoid dup printing (Stephan Kulow)

---
magic/Magdir/images | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/magic/Magdir/images b/magic/Magdir/images
index d14c1de19..7e6f74d5e 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -35,11 +35,6 @@
>>>16 ubyte <33
# skip more by looking for pixel size 0Fh 10h 18h 20h
>>>>16 ubyte&0xC0 0x00
-# skip 260-16.ico by looking for no color map
->>>>>1 ubyte 0
-# implies no first map entry
->>>>>>3 uleshort 0
->>>>>>>0 use tga-image
# Color Map
>>>>>1 belong&0xfff7ffff 0x01010000
>>>>>>0 use tga-image
@@ -47,6 +42,12 @@
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00030000
>>>>>>0 use tga-image
+>>>>>1 default x
+# skip 260-16.ico by looking for no color map
+>>>>>>1 ubyte 0
+# implies no first map entry
+>>>>>>>3 uleshort 0
+>>>>>>>>0 use tga-image
# display tga bitmap image information
0 name tga-image
>2 ubyte <34 Targa image data
4 changes: 3 additions & 1 deletion ext/fileinfo/tests/finfo_file_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
array(9) {
array(10) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
Expand All @@ -37,4 +37,6 @@ array(9) {
string(9) "image/png"
["%s/resources/test.ppt"]=>
string(29) "application/vnd.ms-powerpoint"
["%s/resources/test.tga"]=>
string(11) "image/x-tga"
}
17 changes: 9 additions & 8 deletions ext/fileinfo/tests/magic
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@
# http://home.earthlink.net/~hughhood/appleiiworksenvoy/
# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type')
# $70 $1A $F8 $FF is this the apple type ?
#:apple pdosp��
#:apple pdosp��
!:ext awp
# minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
>>>183 ubyte 30 3.0
Expand Down Expand Up @@ -7299,9 +7299,9 @@
#>>52 ulelong 3 \b, CleanShutdown
>>52 ulelong 4 \b, BeingConverted
>>52 ulelong 5 \b, ForceDetach
# Windows�NT major version when the databases indexes were updated.
# Windows�NT major version when the databases indexes were updated.
>>216 ulelong x \b, Windows version %d
# Windows�NT minor version
# Windows�NT minor version
>>220 ulelong x \b.%d

# From: Joerg Jenderek
Expand Down Expand Up @@ -13280,18 +13280,19 @@
>>>16 ubyte <33
# skip more by looking for pixel size 0Fh 10h 18h 20h
>>>>16 ubyte&0xC0 0x00
# skip 260-16.ico by looking for no color map
>>>>>1 ubyte 0
# implies no first map entry
>>>>>>3 uleshort 0
>>>>>>>0 use tga-image
# Color Map
>>>>>1 belong&0xfff7ffff 0x01010000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00020000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00030000
>>>>>>0 use tga-image
>>>>>1 default x
# skip 260-16.ico by looking for no color map
>>>>>>1 ubyte 0
# implies no first map entry
>>>>>>>3 uleshort 0
>>>>>>>>0 use tga-image
# display tga bitmap image information
0 name tga-image
>2 ubyte <34 Targa image data
Expand Down
31 changes: 16 additions & 15 deletions ext/fileinfo/tests/magic私はガラスを食べられます
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@
# http://home.earthlink.net/~hughhood/appleiiworksenvoy/
# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type')
# $70 $1A $F8 $FF is this the apple type ?
#:apple pdosp��
#:apple pdosp��
!:ext awp
# minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
>>>183 ubyte 30 3.0
Expand Down Expand Up @@ -7299,9 +7299,9 @@
#>>52 ulelong 3 \b, CleanShutdown
>>52 ulelong 4 \b, BeingConverted
>>52 ulelong 5 \b, ForceDetach
# Windows�NT major version when the databases indexes were updated.
# Windows�NT major version when the databases indexes were updated.
>>216 ulelong x \b, Windows version %d
# Windows�NT minor version
# Windows�NT minor version
>>220 ulelong x \b.%d

# From: Joerg Jenderek
Expand Down Expand Up @@ -13280,18 +13280,19 @@
>>>16 ubyte <33
# skip more by looking for pixel size 0Fh 10h 18h 20h
>>>>16 ubyte&0xC0 0x00
# skip 260-16.ico by looking for no color map
>>>>>1 ubyte 0
# implies no first map entry
>>>>>>3 uleshort 0
>>>>>>>0 use tga-image
# Color Map
>>>>>1 belong&0xfff7ffff 0x01010000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00020000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00030000
>>>>>>0 use tga-image
>>>>>1 default x
# skip 260-16.ico by looking for no color map
>>>>>>1 ubyte 0
# implies no first map entry
>>>>>>>3 uleshort 0
>>>>>>>>0 use tga-image
# display tga bitmap image information
0 name tga-image
>2 ubyte <34 Targa image data
Expand Down Expand Up @@ -18470,23 +18471,23 @@

# skip some AppleWorks word like Tomahawk.Awp, WIN98SE-DE.vhd
# by looking for trailing nul of maximal file name string
0x52 ubyte 0
0x52 ubyte 0
# test for flag byte: FFh~complete file, 00h~split file
# FFh -127 = -1 -127 = -128
# 00h -127 = 0 -127 = -127
>0 byte-127 <-126
# plausibility check for file name length
>>0x53 ubyte-1 <78
>>0x53 ubyte-1 <78
# looking for terminating nul of file name string
>>>(0x53.b+4) ubyte 0
>>>(0x53.b+4) ubyte 0
# looking if last char of string is valid DOS file name
>>>>(0x53.b+3) ubyte >0x1F
>>>>(0x53.b+3) ubyte >0x1F
# actually 44 nul bytes
# but sometimes garbage according to Ralf Quint. So can not be used as test
#>0x54 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
# first char of full file name is DOS (5Ch) or UNIX (2Fh) path separator
# only DOS variant found. UNIX variant according to V32SLASH.TXT in archive PD0315.EXE
>>>>>5 ubyte&0x8C 0x0C
# only DOS variant found. UNIX variant according to V32SLASH.TXT in archive PD0315.EXE
>>>>>5 ubyte&0x8C 0x0C
# ./msdos (version 5.30) labeled the entry as
# "DOS 2.0 backed up file %s, split file, sequence %d" or
# "DOS 2.0 backed up file %s, complete file"
Expand All @@ -18501,7 +18502,7 @@
# magic/Magdir/msdos, 1169: Warning: EXTENSION type ` *' has bad char '*'
# file: line 1169: Bad magic entry ' *'
# after header original file content
>>>>>>128 indirect x \b;
>>>>>>128 indirect x \b;


# DOS backup 3.3 to 5.x
Expand Down
Binary file added ext/fileinfo/tests/resources/test.tga
Binary file not shown.