mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2026-11-25 21:27:36 +00:00
Found some ShrinkIt archives that have HTML tags prepending the actual file (which somehow appear to be fine). Adjusted the detection routine.
This commit is contained in:
1 parent
d4c8ac7862
commit
e9d9ee25c6
1 file changed
+8
+8
@@ -37,5 +37,13 @@ public class ShrinkitFileStoreFactory implements FileStoreFactory {
|
||||
if (Arrays.equals(ByteConstants.NUFILE_ID, buffer.asBytes())) {
|
||||
ctx.fileStores.add(new ShrinkitFileStore(ctx.source));
|
||||
}
|
||||
else if (buffer.getUnsignedByte(0) == '<') {
|
||||
// Sometimes it gets wrapped in HTML (how??); want to leave the other legit
|
||||
// embeddings alone (Binary II, for example).
|
||||
buffer = ctx.source.readBytes(0, 0x100);
|
||||
buffer.scan(ByteConstants.NUFILE_ID, 0).ifPresent(_ -> {
|
||||
ctx.fileStores.add(new ShrinkitFileStore(ctx.source));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user