Trim path separators from start of filenames on extract

This commit is contained in:
Matt Nadareski
2026-07-05 23:28:24 -04:00
parent 4083aed12f
commit a602686551
28 changed files with 31 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ namespace SabreTools.Wrappers
// Ensure directory separators are consistent
var filename = entry.Path.TrimEnd('\0');
filename = filename.TrimStart(['\\', '/']);
if (Path.DirectorySeparatorChar == '\\')
filename = filename.Replace('/', '\\');
else if (Path.DirectorySeparatorChar == '/')