mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
Trim path separators from start of filenames on extract
This commit is contained in:
@@ -83,6 +83,7 @@ namespace SabreTools.Wrappers
|
||||
|
||||
// Ensure directory separators are consistent
|
||||
string filename = entry.Name.Length == 0 ? $"FILE_{i}" : entry.Name;
|
||||
filename = filename.TrimStart(['\\', '/']);
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
filename = filename.Replace('/', '\\');
|
||||
else if (Path.DirectorySeparatorChar == '/')
|
||||
@@ -601,6 +602,7 @@ namespace SabreTools.Wrappers
|
||||
|
||||
// Ensure directory separators are consistent
|
||||
string filename = entry.Filename?.TrimEnd('\0') ?? $"FILE_{i}";
|
||||
filename = filename.TrimStart(['\\', '/']);
|
||||
if (Path.DirectorySeparatorChar == '\\')
|
||||
filename = filename.Replace('/', '\\');
|
||||
else if (Path.DirectorySeparatorChar == '/')
|
||||
|
||||
Reference in New Issue
Block a user