[File] [PATCH] fix accidental 'any char' regexps

Dirk Müller dirk at dmllr.de
Sun Mar 13 20:37:40 UTC 2022

In several occassions the regexps were using '\.' when '\\.'
was intended, as the libmagic parsing does one level of dequoting.

This is important as it causes "any char" to match rather than ".", and
makes the regexps fall to backtracking where not needed. So avoiding
that makes things more performant and more correct.

Also when we're returning version numbers, search for nonempty matches.
Add sanity check during compile step that prints a warning.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Tighten-any-char-matches.patch
Type: text/x-patch
Size: 7087 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220313/8492a7fd/attachment.bin>

More information about the File mailing list