head 1.7; access; symbols netbsd-11-0-RC5:1.6 FILE5_48:1.1.1.6 netbsd-11-0-RC4:1.6 netbsd-11-0-RC3:1.6 netbsd-11-0-RC2:1.6 netbsd-11-0-RC1:1.6 perseant-exfatfs-base-20250801:1.6 netbsd-11:1.6.0.10 netbsd-11-base:1.6 netbsd-10-1-RELEASE:1.6 perseant-exfatfs-base-20240630:1.6 perseant-exfatfs:1.6.0.8 perseant-exfatfs-base:1.6 netbsd-8-3-RELEASE:1.5 netbsd-9-4-RELEASE:1.5 netbsd-10-0-RELEASE:1.6 netbsd-10-0-RC6:1.6 netbsd-10-0-RC5:1.6 netbsd-10-0-RC4:1.6 netbsd-10-0-RC3:1.6 netbsd-10-0-RC2:1.6 netbsd-10-0-RC1:1.6 FILE5_45:1.1.1.5 netbsd-10:1.6.0.6 netbsd-10-base:1.6 FILE5_43:1.1.1.5 netbsd-9-3-RELEASE:1.5 cjep_sun2x-base1:1.6 cjep_sun2x:1.6.0.4 cjep_sun2x-base:1.6 cjep_staticlib_x-base1:1.6 netbsd-9-2-RELEASE:1.5 cjep_staticlib_x:1.6.0.2 cjep_staticlib_x-base:1.6 FILE5_40:1.1.1.5 netbsd-9-1-RELEASE:1.5 FILE5_39:1.1.1.4 phil-wifi-20200421:1.5 phil-wifi-20200411:1.5 is-mlppp:1.5.0.14 is-mlppp-base:1.5 phil-wifi-20200406:1.5 netbsd-8-2-RELEASE:1.5 netbsd-9-0-RELEASE:1.5 netbsd-9-0-RC2:1.5 FILE5_38:1.1.1.4 netbsd-9-0-RC1:1.5 phil-wifi-20191119:1.5 netbsd-9:1.5.0.12 netbsd-9-base:1.5 phil-wifi-20190609:1.5 netbsd-8-1-RELEASE:1.5 FILE5_37:1.1.1.4 netbsd-8-1-RC1:1.5 pgoyette-compat-merge-20190127:1.5 pgoyette-compat-20190127:1.5 pgoyette-compat-20190118:1.5 pgoyette-compat-1226:1.5 pgoyette-compat-1126:1.5 pgoyette-compat-1020:1.5 FILE5_35:1.1.1.4 pgoyette-compat-0930:1.5 pgoyette-compat-0906:1.5 netbsd-7-2-RELEASE:1.4 pgoyette-compat-0728:1.5 netbsd-8-0-RELEASE:1.5 phil-wifi:1.5.0.10 phil-wifi-base:1.5 pgoyette-compat-0625:1.5 netbsd-8-0-RC2:1.5 pgoyette-compat-0521:1.5 pgoyette-compat-0502:1.5 pgoyette-compat-0422:1.5 netbsd-8-0-RC1:1.5 FILE5_33:1.1.1.4 pgoyette-compat-0415:1.5 pgoyette-compat-0407:1.5 pgoyette-compat-0330:1.5 pgoyette-compat-0322:1.5 pgoyette-compat-0315:1.5 netbsd-7-1-2-RELEASE:1.4 pgoyette-compat:1.5.0.8 pgoyette-compat-base:1.5 netbsd-7-1-1-RELEASE:1.4 matt-nb8-mediatek:1.5.0.6 matt-nb8-mediatek-base:1.5 FILE5_32:1.1.1.4 perseant-stdc-iso10646:1.5.0.4 perseant-stdc-iso10646-base:1.5 netbsd-8:1.5.0.2 netbsd-8-base:1.5 FILE5_31:1.1.1.4 prg-localcount2-base3:1.4 prg-localcount2-base2:1.4 prg-localcount2-base1:1.4 prg-localcount2:1.4.0.22 prg-localcount2-base:1.4 pgoyette-localcount-20170426:1.4 bouyer-socketcan-base1:1.4 pgoyette-localcount-20170320:1.4 netbsd-7-1:1.4.0.20 netbsd-7-1-RELEASE:1.4 netbsd-7-1-RC2:1.4 FILE5_30:1.1.1.3 netbsd-7-nhusb-base-20170116:1.4 bouyer-socketcan:1.4.0.18 bouyer-socketcan-base:1.4 pgoyette-localcount-20170107:1.4 netbsd-7-1-RC1:1.4 pgoyette-localcount-20161104:1.4 netbsd-7-0-2-RELEASE:1.4 localcount-20160914:1.4 netbsd-7-nhusb:1.4.0.16 netbsd-7-nhusb-base:1.4 pgoyette-localcount-20160806:1.4 pgoyette-localcount-20160726:1.4 pgoyette-localcount:1.4.0.14 pgoyette-localcount-base:1.4 netbsd-7-0-1-RELEASE:1.4 netbsd-7-0:1.4.0.12 netbsd-7-0-RELEASE:1.4 netbsd-7-0-RC3:1.4 netbsd-7-0-RC2:1.4 netbsd-7-0-RC1:1.4 FILE5_22:1.1.1.3 FILE5_20:1.1.1.3 netbsd-6-0-6-RELEASE:1.3 netbsd-6-1-5-RELEASE:1.3 netbsd-7:1.4.0.10 netbsd-7-base:1.4 FILE5_19:1.1.1.3 yamt-pagecache-base9:1.4 yamt-pagecache-tag8:1.3.4.1 netbsd-6-1-4-RELEASE:1.3 netbsd-6-0-5-RELEASE:1.3 tls-earlyentropy:1.4.0.8 tls-earlyentropy-base:1.4 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4 riastradh-drm2-base3:1.4 netbsd-6-1-3-RELEASE:1.3 netbsd-6-0-4-RELEASE:1.3 FILE5_16:1.1.1.3 netbsd-6-1-2-RELEASE:1.3 netbsd-6-0-3-RELEASE:1.3 netbsd-6-1-1-RELEASE:1.3 riastradh-drm2-base2:1.4 riastradh-drm2-base1:1.4 riastradh-drm2:1.4.0.2 riastradh-drm2-base:1.4 netbsd-6-1:1.3.0.14 netbsd-6-0-2-RELEASE:1.3 netbsd-6-1-RELEASE:1.3 khorben-n900:1.4.0.6 netbsd-6-1-RC4:1.3 netbsd-6-1-RC3:1.3 agc-symver:1.4.0.4 agc-symver-base:1.4 FILE5_14:1.1.1.3 netbsd-6-1-RC2:1.3 netbsd-6-1-RC1:1.3 yamt-pagecache-base8:1.4 FILE_5_12:1.1.1.3 netbsd-6-0-1-RELEASE:1.3 yamt-pagecache-base7:1.3 matt-nb6-plus-nbase:1.3 yamt-pagecache-base6:1.3 netbsd-6-0:1.3.0.12 netbsd-6-0-RELEASE:1.3 netbsd-6-0-RC2:1.3 tls-maxphys:1.3.0.10 tls-maxphys-base:1.4 matt-nb6-plus:1.3.0.8 matt-nb6-plus-base:1.3 netbsd-6-0-RC1:1.3 yamt-pagecache-base5:1.3 yamt-pagecache-base4:1.3 FILE5_11:1.1.1.2 netbsd-6:1.3.0.6 netbsd-6-base:1.3 yamt-pagecache-base3:1.3 yamt-pagecache-base2:1.3 yamt-pagecache:1.3.0.4 yamt-pagecache-base:1.3 FILE5_09:1.1.1.2 cherry-xenmp:1.3.0.2 cherry-xenmp-base:1.3 FILE5_07:1.1.1.2 bouyer-quota2-nbase:1.2 bouyer-quota2:1.2.0.2 bouyer-quota2-base:1.2 matt-mips64-premerge-20101231:1.2 matt-premerge-20091211:1.2 jym-xensuspend-base:1.1.1.1 jym-xensuspend:1.1.1.1.0.2 jym-xensuspend-nbase:1.1.1.1 FILE5_03:1.1.1.1 CHRISTOS:1.1.1; locks; strict; comment @# @; 1.7 date 2026.06.10.20.54.16; author christos; state Exp; branches; next 1.6; commitid 7mUHk6JZASLAkiJG; 1.6 date 2021.04.09.19.11.41; author christos; state Exp; branches; next 1.5; commitid hKe2GL3vw8SVrEOC; 1.5 date 2017.05.25.00.11.26; author christos; state Exp; branches; next 1.4; commitid FQJOXzdL3jIJCHSz; 1.4 date 2013.01.03.23.05.37; author christos; state Exp; branches; next 1.3; 1.3 date 2011.05.13.01.52.13; author christos; state Exp; branches 1.3.4.1 1.3.10.1; next 1.2; 1.2 date 2009.09.13.22.16.45; author wiz; state Exp; branches; next 1.1; 1.1 date 2009.05.08.16.35.08; author christos; state Exp; branches 1.1.1.1; next ; 1.3.4.1 date 2013.01.23.00.04.35; author yamt; state Exp; branches; next ; 1.3.10.1 date 2013.02.25.00.26.06; author tls; state Exp; branches; next ; 1.1.1.1 date 2009.05.08.16.35.08; author christos; state Exp; branches 1.1.1.1.2.1; next 1.1.1.2; 1.1.1.2 date 2011.05.12.20.46.59; author christos; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2013.01.03.16.27.54; author christos; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2017.05.24.23.59.57; author christos; state Exp; branches; next 1.1.1.5; commitid WbyOU2LBE5qOyHSz; 1.1.1.5 date 2021.04.09.18.58.01; author christos; state Exp; branches; next 1.1.1.6; commitid W9ddLLbSkHHinEOC; 1.1.1.6 date 2026.06.10.15.59.13; author christos; state Exp; branches; next ; commitid 3UWc0DrzTz7bHgJG; 1.1.1.1.2.1 date 2009.05.08.16.35.08; author jym; state dead; branches; next 1.1.1.1.2.2; 1.1.1.1.2.2 date 2009.05.13.18.51.55; author jym; state Exp; branches; next ; desc @@ 1.7 log @merge changes between file-5.45 and file-5.48 @ text @ #------------------------------------------------------------------------------ # $File: diff,v 1.21 2024/07/13 14:47:09 christos Exp $ # diff: file(1) magic for diff(1) output # # Update: Joerg Jenderek # URL: https://en.wikipedia.org/wiki/Diff # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff.trid.xml # Note: called "diff output text" by TrID and # "Differences between files" by shared MIME-info database from freedesktop.org # According to shared MIME-info database also tabulator character instead of space character and # by TrID minus character after space character 0 search/1 diff\040 diff output text # diff output text (strength=40=40+0) after unified diff output (strength=131=38+93) #!:strength +0 !:mime text/x-diff #!:mime text/x-patch !:ext diff/patch # no short named pch dif examples found #!:ext diff/patch/dif/pch # URL: https://en.wikipedia.org/wiki/Diff_utility#Context_format # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff-context.trid.xml # Note: called "context diff output" by TrID # and "Differences between files" by shared MIME-info database from freedesktop.org 0 search/1 ***\040 # context diff output text (strength=42=38+4) before # C source (strength=41,39,37) exported SGML document (strength=39,28) !:strength +4 >&0 search/1024 \n---\040 context diff output text !:mime text/x-diff #!:mime text/x-patch !:ext diff/patch # no short named pch dif examples found #!:ext diff/patch/dif/pch 0 search/1 Only\040in\040 diff output text # diff output text output text (strength=38=38+0) after unified diff output (strength=131=38+93) #!:strength +0 !:mime text/x-diff #!:mime text/x-patch !:ext diff 0 search/1 Common\040subdirectories:\040 diff output text !:mime text/x-diff # URL: https://en.wikipedia.org/wiki/Diff#Extensions # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff-rcs.trid.xml # Note: called "RCS/CVS diff output" by TrID # and "Differences between files" by shared MIME-info database from freedesktop.org 0 search/1 Index: RCS/CVS diff output text # RCS/CVS diff output text (strength=36=36+0) after unified diff output (strength=131=38+93) #!:strength +0 !:mime text/x-diff #!:mime text/x-patch !:ext diff/patch # bsdiff: file(1) magic for bsdiff(1) output # Update: Joerg Jenderek # URL: http://www.daemonology.net/bsdiff/ # Reference: https://github.com/cperciva/bsdiff/blob/master/bsdiff-ra/FORMAT # http://mark0.net/download/triddefs_xml.7z/defs/b/bsdiff.trid.xml # Note: called "bsdiff patch" by TrID and and "BSDIFF" version 4.0 by DROID via PUID fmt/439 and # "Binary differences between files" by shared MIME-info database from freedesktop.org 0 string/b BSDIFF40 # skip DROID fmt-439-signature-id-672.bsdiff with invalid new file segment length 0 >16 long !0 bsdiff(1) patch file #!:mime application/octet-stream !:mime application/x-bsdiff !:ext bsdiff # new file length #>>8 lequad x \b, new length %lld # new file segment length #>>16 lelong x \b, new segment length %d # compressed header block length #>>20 lelong !0 \b, compressed header length %d # patch data block length #>>24 lequad x \b, data length %lld # look for bzip data by ./compress after message with 1 space at end >>0x20 indirect x \b, at 0x20 # From: Joerg Jenderek # URL: https://www.chromium.org/developers/design-documents/software-updates-courgette/ # Reference: https://github.com/adobe/chromium/blob/master/courgette/third_party/bsdiff.h # http://mark0.net/download/triddefs_xml.7z/defs/b/bsdiff-chrome.trid.xml # Note: called "Courgette Binary Diff output" by TrID # the Courgette bsdiff tool use a total different file format compared with BSD variant from Colin Percival 0 string/b GBSDIF42 Courgette binary diff output #!:mime application/octet-stream !:mime application/x-patch !:ext patch/bsdiff # slen; length of the file to be patched #>8 ubelong x \b, source length %u # scrc32; CRC32 of the file to be patched >12 ubelong x \b, crc %#8.8x # dlen; length of the result file #>16 ubelong x \b, result length %u # cblen; length of the control block #>20 ubelong x \b, control length %u # difflen; length of the diff block #>24 ubelong x \b, patch length %u # extralen; length of the extra block #>28 ubelong x \b, extra length %u # unified diff # URL: http://fileformats.archiveteam.org/wiki/Unified_diff # https://en.wikipedia.org/wiki/Diff_utility#Unified_format # Reference: https://www.artima.com/weblogs/viewpost.jsp?thread=164293 # http://mark0.net/download/triddefs_xml.7z/defs/d/diff-unified.trid.xml # Note: called "unified diff output" by TrID and # "Differences between files" by shared MIME-info database from freedesktop.org # use b flag to forces the test to be done for binary files (non ASCII text like with Ctrl-D Ctrl-V Ctrl-Z) 0 search/4096/b ---\040 !:strength + 93 >0 use diff-unified # most samples are just pure ASCII text like: ShellR64.patch 0 search/11054 ---\040 # unified diff (strength=131=38+93) before # HTML document text (strength=170,90,71,53,52,51,49) POSIX shell script (fix-qt5.6-build.patch strength=130 ./commands) # JavaScript source (strength=112,84,81,80,79,78,72,69) C++ source (strength=71,70,69,68,67,54), # Python script (strength=69,67,63,60,58,57,56,54,52,37)LaTeX document text (strength=62,56,55,51,43) # TeX document (strength=51,38) C source (strength=41,39,37) # exported SGML document (strength=39,28) diff output text (strength=38=38+0) # Pascal source (strength=37) RCS/CVS diff (strength=36=36+0), # Algol 68 source (strength=?) CSV ASCII text (strength=?) !:strength + 93 >0 use diff-unified # check for 3 characteristic lines of unified diff 0 name diff-unified >0 search/11084 +++\040 >>&0 search/1024 \n # at signs line sometimes other (with 2 space chars before) like: indent-header.patch >>>&0 search/2 @@@@\040- unified diff output text !:mime text/x-diff #!:mime text/x-patch # https://file-extension.net/seeker/file_extension_dif file_extension_pch file_extension_rej !:ext diff/patch/dif/pch/rej # GRR: mainly for debugging purpose for variants with text before real diff output >>>>0 string !---\040 >>>>>0 string x \b, 1st line "%s" >>>>>>&1 string x \b, 2nd line "%s" >>>>>>>&1 string x \b, 3rd line "%s" # librsync -- the library for network deltas # # Copyright (C) 2001 by Martin Pool. You may do whatever you want with # this file. # 0 belong 0x72730236 rdiff network-delta data 0 belong 0x72730136 rdiff network-delta signature data >4 belong x (block length=%d, >8 belong x signature strength=%d) @ 1.6 log @merge local changes between 5.39 and 5.40 and add magic entries from HEAD. @ text @d3 1 a3 1 # $File: diff,v 1.17 2020/08/22 18:16:58 christos Exp $ d6 7 d14 2 d17 8 d26 3 d31 4 d36 2 d39 2 d44 4 d49 2 d52 2 d56 45 a100 2 0 string/b BSDIFF40 bsdiff(1) patch file d103 37 a139 7 0 search/4096 ---\040 >&0 search/1024 \n >>&0 search/1 +++\040 >>>&0 search/1024 \n >>>>&0 search/1 @@@@ unified diff output text !:mime text/x-diff !:strength + 90 @ 1.5 log @merge 5.31 @ text @d3 1 a3 1 # $File: diff,v 1.16 2017/03/17 22:20:22 christos Exp $ d8 2 a9 1 0 search/1 ***\040 diff output text d20 1 a20 1 0 string/b BSDIFF40 bsdiff(1) patch file d25 4 a28 4 >&0 search/1024 \n >>&0 search/1 +++\040 >>>&0 search/1024 \n >>>>&0 search/1 @@@@ unified diff output text @ 1.4 log @merge changes @ text @d3 1 a3 1 # $File: diff,v 1.14 2012/09/16 23:08:54 christos Exp $ d6 1 a6 1 0 search/1 diff\ diff output text d8 1 a8 1 0 search/1 ***\ diff output text d10 1 a10 1 0 search/1 Only\ in\ diff output text d12 1 a12 1 0 search/1 Common\ subdirectories:\ diff output text d23 1 a23 1 0 search/4096 ---\ d25 1 a25 1 >>&0 search/1 +++\ @ 1.3 log @resolve conflicts @ text @d3 1 a3 1 # $File: diff,v 1.12 2010/12/07 16:52:52 christos Exp $ d19 1 a19 1 0 string/t BSDIFF40 bsdiff(1) patch file d30 11 @ 1.3.10.1 log @resync with head @ text @d3 1 a3 1 # $File: diff,v 1.14 2012/09/16 23:08:54 christos Exp $ d19 1 a19 1 0 string/b BSDIFF40 bsdiff(1) patch file a29 11 # librsync -- the library for network deltas # # Copyright (C) 2001 by Martin Pool. You may do whatever you want with # this file. # 0 belong 0x72730236 rdiff network-delta data 0 belong 0x72730136 rdiff network-delta signature data >4 belong x (block length=%d, >8 belong x signature strength=%d) @ 1.3.4.1 log @sync with head @ text @d3 1 a3 1 # $File: diff,v 1.14 2012/09/16 23:08:54 christos Exp $ d19 1 a19 1 0 string/b BSDIFF40 bsdiff(1) patch file a29 11 # librsync -- the library for network deltas # # Copyright (C) 2001 by Martin Pool. You may do whatever you want with # this file. # 0 belong 0x72730236 rdiff network-delta data 0 belong 0x72730136 rdiff network-delta signature data >4 belong x (block length=%d, >8 belong x signature strength=%d) @ 1.2 log @Recognize bsdiff(1) files. Patch already sent upstream. @ text @d1 1 d3 1 d17 1 a17 2 # #------------------------------------------------------------------------------ d19 11 a29 2 # 0 string BSDIFF40 bsdiff(1) patch file @ 1.1 log @Initial revision @ text @d15 5 @ 1.1.1.1 log @from ftp.astron.com @ text @@ 1.1.1.2 log @from ftp.astron.com. - many security related fixes - no MAXPATHLEN limits - fixed missing text specification on ascii magic - new ``pascal'' style string formats - whitespace comparison fix - more magic @ text @a0 1 a1 1 # $File: diff,v 1.12 2010/12/07 16:52:52 christos Exp $ a14 13 # bsdiff: file(1) magic for bsdiff(1) output 0 string/t BSDIFF40 bsdiff(1) patch file # unified diff 0 search/4096 ---\ >&0 search/1024 \n >>&0 search/1 +++\ >>>&0 search/1024 \n >>>>&0 search/1 @@@@ unified diff output text !:mime text/x-diff !:strength + 90 @ 1.1.1.3 log @from ftp.astron.com @ text @d3 1 a3 1 # $File: diff,v 1.14 2012/09/16 23:08:54 christos Exp $ d19 1 a19 1 0 string/b BSDIFF40 bsdiff(1) patch file a29 11 # librsync -- the library for network deltas # # Copyright (C) 2001 by Martin Pool. You may do whatever you want with # this file. # 0 belong 0x72730236 rdiff network-delta data 0 belong 0x72730136 rdiff network-delta signature data >4 belong x (block length=%d, >8 belong x signature strength=%d) @ 1.1.1.4 log @Import file-5.31; mostly oss-fuzz found bugs. @ text @d3 1 a3 1 # $File: diff,v 1.16 2017/03/17 22:20:22 christos Exp $ d6 1 a6 1 0 search/1 diff\040 diff output text d8 1 a8 1 0 search/1 ***\040 diff output text d10 1 a10 1 0 search/1 Only\040in\040 diff output text d12 1 a12 1 0 search/1 Common\040subdirectories:\040 diff output text d23 1 a23 1 0 search/4096 ---\040 d25 1 a25 1 >>&0 search/1 +++\040 @ 1.1.1.5 log @2021-03-30 20:21 Christos Zoulas * release 5.40 2021-02-05 16:31 Christos Zoulas * PR/234: Add limit to the number of bytes to scan for encoding * PR/230: Fix /T (trim flag) for regex 2021-02-01 12:31 Christos Zoulas * PR/77: Trim trailing separator. 2020-12-17 15:44 Christos Zoulas * PR/211: Convert system read errors from corrupt ELF files into human readable error messages 2020-12-08 16:24 Christos Zoulas * fix multithreaded decompression file descriptor issue by using close-on-exec (Denys Vlasenko) 2020-06-27 11:58 Christos Zoulas * Exclude surrogate pairs from utf-8 detection (Michael Liu) 2020-06-25 12:53 Christos Zoulas * Include # to the list of ignored format chars (Werner Fink) @ text @d3 1 a3 1 # $File: diff,v 1.17 2020/08/22 18:16:58 christos Exp $ d8 1 a8 2 0 search/1 ***\040 >&0 search/1024 \n---\040 context diff output text d19 1 a19 1 0 string/b BSDIFF40 bsdiff(1) patch file d24 4 a27 4 >&0 search/1024 \n >>&0 search/1 +++\040 >>>&0 search/1024 \n >>>>&0 search/1 @@@@ unified diff output text @ 1.1.1.6 log @Import file-5.48 (previous was file-5.45) 2026-05-07 11:32 Christos Zoulas * release 5.48 2026-05-11 15:55 Christos Zoulas * add landlock support (valoq) 2026-04-19 15:55 Christos Zoulas * add BE/LE GUID 2026-04-17 11:05 Christos Zoulas * multiple fixes to prevent integer overflow in 32 bits (kerwin) 2026-04-15 12:40 Christos Zoulas * PR/745: streamout: Don't flush when trying to set negative offsets on pipes, just continue, fixes 'cat file.zip | file -' * PR/753: vmihalko: Fix race is magic_getpath() 2026-03-11 15:14 Christos Zoulas * PR/728: Anton Monroe: Reinstate regex/c 2026-02-26 11:32 Christos Zoulas * release 5.47 2026-02-04 09:54 Christos Zoulas * Better multi-compound document identification by following the order of the directories entries. (Thomas Ledoux) 2026-01-19 14:00 Christos Zoulas * if stat fails, don't attempt to restore times (Steven Grubb) 2025-05-28 15:20 Christos Zoulas * PR/622: Odd_Bloke: Handle negative offsets in file_buffer(), when fd is not available. 2025-05-28 12:50 Christos Zoulas * PR/655: jsummers: Obey str_flags in strings like we do for search and regex * PR/659: Pitzl: Apply MAGIC_CONTINUE to annotations; i.e. print only the first, unless -k is specified. 2024-12-19 14:44 Christos Zoulas * PR/592: allow + in format strings * PR/592: signed operations should be done in signed context 2024-12-05 13:50 Christos Zoulas * PR/578: jsummers: Don't crash on cygwin when tm_mon == -1 * PR/579: net147: Fix stack overrun. 2024-11-27 14:44 Christos Zoulas * release 5.46 * Add OFFPOSITIVE 2024-11-25 13:56 Christos Zoulas * avoid leaking symbols in libmagic 2024-11-10 13:56 Christos Zoulas * PR/562: jsummers: Search/regex offsets are absolute to the beginning of the file, so adjust them by subtracting the offset that the "use" starts so that we don't double-count it. 2024-11-09 19:30 Christos Zoulas * PR/543: matshch: bump nbuf so we can get the flags into the buffer. 2024-11-02 14:34 Christos Zoulas * Add Android elf notes (enh) 2023-12-29 12:55 Christos Zoulas * Add limit for number of magic warnings allowed 2023-07-29 12:55 Christos Zoulas * check regex bounds (found by clusterfuzz) @ text @d3 1 a3 1 # $File: diff,v 1.21 2024/07/13 14:47:09 christos Exp $ a5 7 # Update: Joerg Jenderek # URL: https://en.wikipedia.org/wiki/Diff # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff.trid.xml # Note: called "diff output text" by TrID and # "Differences between files" by shared MIME-info database from freedesktop.org # According to shared MIME-info database also tabulator character instead of space character and # by TrID minus character after space character a6 2 # diff output text (strength=40=40+0) after unified diff output (strength=131=38+93) #!:strength +0 a7 8 #!:mime text/x-patch !:ext diff/patch # no short named pch dif examples found #!:ext diff/patch/dif/pch # URL: https://en.wikipedia.org/wiki/Diff_utility#Context_format # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff-context.trid.xml # Note: called "context diff output" by TrID # and "Differences between files" by shared MIME-info database from freedesktop.org a8 3 # context diff output text (strength=42=38+4) before # C source (strength=41,39,37) exported SGML document (strength=39,28) !:strength +4 a10 4 #!:mime text/x-patch !:ext diff/patch # no short named pch dif examples found #!:ext diff/patch/dif/pch a11 2 # diff output text output text (strength=38=38+0) after unified diff output (strength=131=38+93) #!:strength +0 a12 2 #!:mime text/x-patch !:ext diff a15 4 # URL: https://en.wikipedia.org/wiki/Diff#Extensions # Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/diff-rcs.trid.xml # Note: called "RCS/CVS diff output" by TrID # and "Differences between files" by shared MIME-info database from freedesktop.org a16 2 # RCS/CVS diff output text (strength=36=36+0) after unified diff output (strength=131=38+93) #!:strength +0 a17 2 #!:mime text/x-patch !:ext diff/patch d20 2 a21 45 # Update: Joerg Jenderek # URL: http://www.daemonology.net/bsdiff/ # Reference: https://github.com/cperciva/bsdiff/blob/master/bsdiff-ra/FORMAT # http://mark0.net/download/triddefs_xml.7z/defs/b/bsdiff.trid.xml # Note: called "bsdiff patch" by TrID and and "BSDIFF" version 4.0 by DROID via PUID fmt/439 and # "Binary differences between files" by shared MIME-info database from freedesktop.org 0 string/b BSDIFF40 # skip DROID fmt-439-signature-id-672.bsdiff with invalid new file segment length 0 >16 long !0 bsdiff(1) patch file #!:mime application/octet-stream !:mime application/x-bsdiff !:ext bsdiff # new file length #>>8 lequad x \b, new length %lld # new file segment length #>>16 lelong x \b, new segment length %d # compressed header block length #>>20 lelong !0 \b, compressed header length %d # patch data block length #>>24 lequad x \b, data length %lld # look for bzip data by ./compress after message with 1 space at end >>0x20 indirect x \b, at 0x20 # From: Joerg Jenderek # URL: https://www.chromium.org/developers/design-documents/software-updates-courgette/ # Reference: https://github.com/adobe/chromium/blob/master/courgette/third_party/bsdiff.h # http://mark0.net/download/triddefs_xml.7z/defs/b/bsdiff-chrome.trid.xml # Note: called "Courgette Binary Diff output" by TrID # the Courgette bsdiff tool use a total different file format compared with BSD variant from Colin Percival 0 string/b GBSDIF42 Courgette binary diff output #!:mime application/octet-stream !:mime application/x-patch !:ext patch/bsdiff # slen; length of the file to be patched #>8 ubelong x \b, source length %u # scrc32; CRC32 of the file to be patched >12 ubelong x \b, crc %#8.8x # dlen; length of the result file #>16 ubelong x \b, result length %u # cblen; length of the control block #>20 ubelong x \b, control length %u # difflen; length of the diff block #>24 ubelong x \b, patch length %u # extralen; length of the extra block #>28 ubelong x \b, extra length %u d24 7 a30 37 # URL: http://fileformats.archiveteam.org/wiki/Unified_diff # https://en.wikipedia.org/wiki/Diff_utility#Unified_format # Reference: https://www.artima.com/weblogs/viewpost.jsp?thread=164293 # http://mark0.net/download/triddefs_xml.7z/defs/d/diff-unified.trid.xml # Note: called "unified diff output" by TrID and # "Differences between files" by shared MIME-info database from freedesktop.org # use b flag to forces the test to be done for binary files (non ASCII text like with Ctrl-D Ctrl-V Ctrl-Z) 0 search/4096/b ---\040 !:strength + 93 >0 use diff-unified # most samples are just pure ASCII text like: ShellR64.patch 0 search/11054 ---\040 # unified diff (strength=131=38+93) before # HTML document text (strength=170,90,71,53,52,51,49) POSIX shell script (fix-qt5.6-build.patch strength=130 ./commands) # JavaScript source (strength=112,84,81,80,79,78,72,69) C++ source (strength=71,70,69,68,67,54), # Python script (strength=69,67,63,60,58,57,56,54,52,37)LaTeX document text (strength=62,56,55,51,43) # TeX document (strength=51,38) C source (strength=41,39,37) # exported SGML document (strength=39,28) diff output text (strength=38=38+0) # Pascal source (strength=37) RCS/CVS diff (strength=36=36+0), # Algol 68 source (strength=?) CSV ASCII text (strength=?) !:strength + 93 >0 use diff-unified # check for 3 characteristic lines of unified diff 0 name diff-unified >0 search/11084 +++\040 >>&0 search/1024 \n # at signs line sometimes other (with 2 space chars before) like: indent-header.patch >>>&0 search/2 @@@@\040- unified diff output text !:mime text/x-diff #!:mime text/x-patch # https://file-extension.net/seeker/file_extension_dif file_extension_pch file_extension_rej !:ext diff/patch/dif/pch/rej # GRR: mainly for debugging purpose for variants with text before real diff output >>>>0 string !---\040 >>>>>0 string x \b, 1st line "%s" >>>>>>&1 string x \b, 2nd line "%s" >>>>>>>&1 string x \b, 3rd line "%s" @ 1.1.1.1.2.1 log @file diff was added on branch jym-xensuspend on 2009-05-13 18:51:55 +0000 @ text @d1 14 @ 1.1.1.1.2.2 log @Sync with HEAD. Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html @ text @a0 14 #------------------------------------------------------------------------------ # diff: file(1) magic for diff(1) output # 0 search/1 diff\ diff output text !:mime text/x-diff 0 search/1 ***\ diff output text !:mime text/x-diff 0 search/1 Only\ in\ diff output text !:mime text/x-diff 0 search/1 Common\ subdirectories:\ diff output text !:mime text/x-diff 0 search/1 Index: RCS/CVS diff output text !:mime text/x-diff @