mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile, ArchiveTools] Fix DFD and zip extraction
This commit is contained in:
@@ -157,6 +157,20 @@ namespace SabreTools.Helper
|
|||||||
|
|
||||||
zr = zf.OpenReadStream(i, false, out readStream, out streamsize, out cm, out lastMod);
|
zr = zf.OpenReadStream(i, false, out readStream, out streamsize, out cm, out lastMod);
|
||||||
|
|
||||||
|
// Create the rest of the path, if needed
|
||||||
|
if (!String.IsNullOrEmpty(Path.GetDirectoryName(zf.Entries[i].FileName)))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Path.Combine(tempDir, Path.GetDirectoryName(zf.Entries[i].FileName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the entry ends with a directory separator, continue to the next item, if any
|
||||||
|
if (zf.Entries[i].FileName.EndsWith(Path.DirectorySeparatorChar.ToString())
|
||||||
|
|| zf.Entries[i].FileName.EndsWith(Path.AltDirectorySeparatorChar.ToString())
|
||||||
|
|| zf.Entries[i].FileName.EndsWith(Path.PathSeparator.ToString()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
FileStream writeStream = File.OpenWrite(Path.Combine(tempDir, zf.Entries[i].FileName));
|
FileStream writeStream = File.OpenWrite(Path.Combine(tempDir, zf.Entries[i].FileName));
|
||||||
|
|
||||||
byte[] ibuffer = new byte[_bufferSize];
|
byte[] ibuffer = new byte[_bufferSize];
|
||||||
@@ -167,10 +181,10 @@ namespace SabreTools.Helper
|
|||||||
writeStream.Flush();
|
writeStream.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
encounteredErrors = false;
|
|
||||||
zr = zf.CloseReadStream();
|
zr = zf.CloseReadStream();
|
||||||
writeStream.Dispose();
|
writeStream.Dispose();
|
||||||
}
|
}
|
||||||
|
encounteredErrors = false;
|
||||||
}
|
}
|
||||||
else if (at == ArchiveType.Rar && (archiveScanLevel & ArchiveScanLevel.RarInternal) != 0)
|
else if (at == ArchiveType.Rar && (archiveScanLevel & ArchiveScanLevel.RarInternal) != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user