Skip to content

Commit

Permalink
fix expanding zip files created on Windows
Browse files Browse the repository at this point in the history
- replace path seperator ('\\' with '/')
- ignore windows specific file attributes
  • Loading branch information
MartinNowak committed Jan 18, 2014
1 parent b524adb commit 91c621b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion create_dmd_release/create_dmd_release.d
Expand Up @@ -1495,14 +1495,17 @@ void extract(string archive, string outputDir)
{
if(!am.expandedSize) continue;

string path = buildPath(outputDir, name);
const fromWindows = (am.madeVersion & 0xFF00) == 0x0000;

string path = buildPath(outputDir, fromWindows ? name.replace("\\", "/") : name);
auto dir = dirName(path);
if(dir != "" && !dir.exists)
mkdirRecurse(dir);
zip.expand(am);
if(verbose)
infoMsg(path);
std.file.write(path, am.expandedData);
version (Posix) if (fromWindows) continue;
std.file.setAttributes(path, am.fileAttributes);
}
}
Expand Down

0 comments on commit 91c621b

Please sign in to comment.