Skip to content

Commit

Permalink
fix: Use PosixPath, not NativePath, for Zip file archive members
Browse files Browse the repository at this point in the history
The root of an archive is `/`, not a drive letter. So while `NativePath` works
here on POSIX, it will not make sense on Windows.
  • Loading branch information
Geod24 committed Jan 6, 2025
1 parent a818277 commit 8332956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/dub/packagemanager.d
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,11 @@ class PackageManager {
logDebug("Extracting from zip.");

// In a GitHub zip, the actual contents are in a sub-folder
alias PSegment = typeof(NativePath.init.head);
alias PSegment = typeof(PosixPath.init.head);
PSegment[] zip_prefix;
outer: foreach(ArchiveMember am; archive.directory) {
try {
auto path = NativePath(am.name).bySegment.array;
auto path = PosixPath(am.name).bySegment.array;
foreach (fil; packageInfoFiles)
if (path.length == 2 && path[$-1].name == fil.filename) {
zip_prefix = path[0 .. $-1];
Expand Down

0 comments on commit 8332956

Please sign in to comment.