These broke in the archive refactor,
b8acbe6bee730a9024e73acc769b54285be9afde/#5108, because it removed
the ability to directly convert an `ArchiveMember` to an `FSNode`.
As a result, it was no longer possible to directly open a resource
fork as a stream.
This commit will fix:
- The dumped games using dumpArchive() are not detected.
- The archive's contents were being dumped one directory back the destPath
For Macintosh, it is possible to have filenames with a "/" in them.
Dumper Companion will punyencode this and any other non-ASCII characters
when extracting from a Macintosh filesystem. As such, when checking
components of a filename, we should attempt to match against the punydecoded
name, but always return the "real" name (i.e. the name of the file in
the local filesystem, possibly punyencoded).
In addition, it is possible for a movie A/B/C.DIR to go to a movie
"E/F.DIR", where the actual path is A/E/F.DIR. To make the partial matching
work, first we try removing each component from the start of the target
path, then retry all combinations again after removing a component from
the end of the source directory, etc.
Fixes several movie switches in The Seven Colors.
Newer versions of Clang can tell us when UBSan has been enabled, which
is useful to define SCUMM_NEED_ALIGNMENT when -fsanitize=alignment is
in use (https://reviews.llvm.org/D52386).
Can be useful to avoid some false positives about alignment when doing
a build with UBSan but without using the "configure" script which
already tries to detect this setting.
See earlier commit 8a73f5d496437f8211c67c1da4c6cc4b200c4970.
In function `PEResources::loadFromEXE`, there were memory leaks
because of not properly handling with streams, and thus when the
loaded movie was bad/non-exe file, the memory was not freed.
This was undetected in normal exe loading because there the streams
were being assigned and closed properly.
b0d722473b49e27417258f03ee802372f3ee354e introduced code that used
ni before this guard that ensures it has a proper value for strings
that contain no ASCII component.
If the illegal character scanner flags the final character, it
shouldn't continue on try to process the tail - it's the end of the
string, and indexing past that is invalid.