mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-21 22:35:06 +00:00
Some filenames in MS-CAB start with one or more separators
This commit is contained in:
@@ -371,6 +371,9 @@ namespace SabreTools.Wrappers
|
||||
/// <returns>Filestream opened for the file</returns>
|
||||
private FileStream GetFileStream(string filename, string outputDirectory)
|
||||
{
|
||||
// Trim directory separators from the start
|
||||
filename = filename.TrimStart(['\\', '/']);
|
||||
|
||||
// Ensure directory separators are consistent
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
filename = filename.Replace('/', '\\');
|
||||
|
||||
Reference in New Issue
Block a user