summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* From: Dirk Mueller:Christos Zoulas2022-04-184-46/+24
| | | | | | | | | Only regcomp() can return an error, regexec() only returns match or no-match. This allows to merge file_regerror into file_regcomp and thereby simplifies the callers of file_regcomp() as they no longer need to handle errors. Also this reduces memory overhead slightly as we can make file_regex_t directly a regex_t, saving ~ 16 bytes per regex.
* From Dirk Mueller:Christos Zoulas2022-04-181-2/+2
| | | | | when name/use was used, the regex caching table was incorrectly initialized, which led to false or missing matches.
* From Dirk Mueller:Christos Zoulas2022-04-181-11/+11
| | | | | There is no need to group if there is no '|' used. magic is never evaluating captive groups.
* From Dirk Mueller:Christos Zoulas2022-04-181-5/+6
| | | | | | | | | | | | | do a final fflush of stdout even in buffered mode so that a ENOSPACE is caught and propagated as an exit code 1 so that the surrounding logic can detect and handle it as a failure rather than silently misbehaving. reproducer is file somefile > /dev/full && echo exit code was 0 Also check printf even if type is null for consistency.
* From Dirk Mueller:Christos Zoulas2022-04-181-14/+14
| | | | | | | | | | | * regex rules need literal dots escaped, otherwise they are considered any character * literal search strings can be searched using search rather than the much more expensive regex * use standard xml declaration search as used in other format matchers * only match the first 1024 bytes, the information we look for should be in the very first tag * remove unnecessary parentheses
* Casts to compile cleanly with g++Christos Zoulas2022-04-114-10/+10
|
* fix unused warningsChristos Zoulas2022-04-112-5/+9
|
* initialize hi;Christos Zoulas2022-04-111-1/+2
|
* use unsigned for holding the hi part of the surrogate pairChristos Zoulas2022-04-111-2/+3
| | | | (found by clusterfuzz)
* PR/332: vinc: Fix misdetection of text file that start with valid json,Christos Zoulas2022-04-046-2/+10
| | | | but have trailing junk.
* PR/334: jmp3r: Filter out bad ucs16 by handling surrogate pairs and invalidChristos Zoulas2022-04-041-10/+31
| | | | characters.
* PR/336: stefanwascoding: fix broken zsh env magicChristos Zoulas2022-04-041-2/+2
|
* intel bios rom parsing and pci vendor id map from Joerg JenderekChristos Zoulas2022-04-023-10/+302
|
* Recognize raspberry pi eeprom files (Joerg Jenderek)Christos Zoulas2022-04-021-1/+24
|
* Fix SAPCAR magic and add mime type (Markus Strehle)Christos Zoulas2022-03-261-2/+6
|
* Escape regex `.' twice since one level is removed by magic parsing.Christos Zoulas2022-03-248-21/+21
| | | | (Dirk Mueller)
* Add detection for unescaped . outside of [] (Dirk Mueller)Christos Zoulas2022-03-241-114/+129
|
* Fix unused warningsChristos Zoulas2022-03-241-4/+6
|
* typo in previousChristos Zoulas2022-03-211-2/+2
|
* PR/326: aichingm: Add support for QGIS filesChristos Zoulas2022-03-211-4/+7
|
* PR/32: wolfgangwalther: Add mime type for woff{,2} fontsChristos Zoulas2022-03-211-1/+3
|
* PR/328: adepasquale: Add more mimetypes and extensionsChristos Zoulas2022-03-214-4/+12
|
* PR/327: vinc17Christos Zoulas2022-03-211-18/+27
| | | | | | - bump the number of levels - add more debugging - make compile in test mode
* PR/329: polluks: Another iff formatChristos Zoulas2022-03-211-1/+2
|
* PR/323: tests fail.Christos Zoulas2022-03-211-1/+1
|
* 5view sniffer improvements from joerg jenderekChristos Zoulas2022-03-201-2/+49
|
* Now that we are cacheing regex's we cannot assume that we alwaysChristos Zoulas2022-03-194-40/+59
| | | | | | do regcomp->regexec->regfree, so this causes memory corruption (and increased memory use with all the locale copies) in xlocale systems. Instead save and restore locales in regcomp and regexec as needed.
* regex caching and filesystem full fixes (Dirk Mueller)Christos Zoulas2022-03-194-89/+136
|
* Handle full disk space errors as failure (Dirk Mueller)Christos Zoulas2022-03-191-19/+22
| | | | While here, re-organize the code a bit.
* PR/332: vmurashev: create magic cookie with MAGIC_ERROR so that missingChristos Zoulas2022-03-161-1/+1
| | | | | files and symlinks that point to nowhere are detected. It is a more useful behavior.
* Avoid double free (lightmouse)Christos Zoulas2022-03-141-1/+0
|
* Improve ARJ information (Joerg Jenderek)Christos Zoulas2022-03-131-15/+125
|
* Recognize (some) openoffice extension files (Joerg Jenderek)Christos Zoulas2022-03-121-1/+13
|
* Combine regex's to improve performance adjusting strength to preserveChristos Zoulas2022-03-121-22/+7
| | | | ranking (Dirk Mueller)
* Recognize Autodesk 3ds Max (Joerg Jenderek)Christos Zoulas2022-02-261-1/+15
|
* Add another pattern to FoxPro FPT so that more files are recognizedChristos Zoulas2022-02-261-3/+5
| | | | (Joerg Jenderek)
* FIG image improvements from Joerg JenderekChristos Zoulas2022-02-191-2/+43
|
* PR/319: jmp3r: UTF-16 does not require a BOMChristos Zoulas2022-02-191-2/+2
|
* PR/316: karagian: Bump strength to beat amd 29k a.outChristos Zoulas2022-02-191-1/+2
|
* Trim the whitespace for consistency.Christos Zoulas2022-02-151-2/+2
|
* Add oric tape format from polluksChristos Zoulas2022-02-152-1/+14
|
* new ccf magic from Georg SauthoffChristos Zoulas2022-02-152-1/+16
|
* PR/315: polluks: Improve console output.Christos Zoulas2022-02-141-6/+9
|
* PR/311: ylep: Add magic for NIfTI: https://nifti.nimh.nih.gov/.Christos Zoulas2022-02-142-1/+204
|
* new arj testChristos Zoulas2022-02-143-0/+3
|
* PR/308: adepasquale: Arj magic improvementsChristos Zoulas2022-02-141-17/+20
|
* PR/310: p870613: Don't use strlcpy to copy the string, it will try to scanChristos Zoulas2022-02-141-4/+7
| | | | | the source string to find out how much space is needed the source string might not be NUL terminated.
* Improve NetCDF, joerg jenderekChristos Zoulas2022-02-081-4/+27
|
* fix mime and extension for mcrypt (Joerg Jenderek)Christos Zoulas2022-02-081-1/+15
|
* Improvements in FreeBSD minidumps from Michal GornyChristos Zoulas2022-01-191-8/+15
|