View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000655 | file | General | public | 2025-05-09 12:16 | 2025-05-28 16:41 |
Reporter | jsummers | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
OS | Ubuntu Linux | ||||
Product Version | 5.46 | ||||
Fixed in Version | HEAD | ||||
Summary | 0000655: Type "string/bt" doesn't work as expected | ||||
Description | Suppose a pattern's first line has type "string/bt" (or "string/b/t"). I would expect the pattern to be able to match both binary and text files, as is the case for "search/bt", "regex/bt", and for just plain "string". But that doesn't happen. Only text files can match, as if it were "string/t". There are only two affected patterns in the current database, both near the beginning of magic/Magdir/sgml. | ||||
Steps To Reproduce | $ echo '<svgABCDEFG' > text_svg.dat $ echo -ne '<svg\0\0\xff\xff\x01\x02' > binary_svg.dat $ file text_svg.dat binary_svg.dat My results: text_svg.dat: SVG Scalable Vector Graphics image, ASCII text binary_svg.dat: data Expected results: text_svg.dat: SVG Scalable Vector Graphics image binary_svg.dat: SVG Scalable Vector Graphics image | ||||
Tags | No tags attached. | ||||
|
I'll add that type "pstring" has the same issue as "string" -- "/bt" seems to behave as if it were "/t". (It's curious that pstring supports /t at all, since none of the documented pstring formats are usable in text files. But, whatever.) |
|
Fixed, thanks! |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-05-09 12:16 | jsummers | New Issue | |
2025-05-09 15:17 | jsummers | Note Added: 0004223 | |
2025-05-28 16:41 | christos | Assigned To | => christos |
2025-05-28 16:41 | christos | Status | new => assigned |
2025-05-28 16:41 | christos | Status | assigned => resolved |
2025-05-28 16:41 | christos | Resolution | open => fixed |
2025-05-28 16:41 | christos | Fixed in Version | => HEAD |
2025-05-28 16:41 | christos | Note Added: 0004238 |