archive: fix path resolution for archive files nested inside archives by halcyon00 · Pull Request #9288 · rclone/rclone

@halcyon00

When accessing a file like inner.zip stored inside outer.zip, the
archive backend would match the full path outer.zip/inner.zip as the
archive (since it ends with .zip) and fail because that path doesn't
exist as a standalone file. It never fell back to trying outer.zip.

Add findAllArchives, which collects all valid archive extension matches
in the path and sorts them longest-first. NewFs now uses this instead
of subArchive, probing each candidate with cache.Get to find which path
actually exists as a file, falling back to shorter matches as needed.

Includes unit tests for findAllArchives and an integration test
verifying that reading a .zip inside a .zip works correctly.