mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Don't assume paths are in the correct format
This commit is contained in:
@@ -361,6 +361,12 @@ namespace SabreTools.FileTypes
|
|||||||
fileName = Path.Combine(outDir, TextHelper.RemovePathUnsafeCharacters(baseFile.Parent) ?? string.Empty, TextHelper.RemovePathUnsafeCharacters(baseFile.Filename) ?? string.Empty);
|
fileName = Path.Combine(outDir, TextHelper.RemovePathUnsafeCharacters(baseFile.Parent) ?? string.Empty, TextHelper.RemovePathUnsafeCharacters(baseFile.Filename) ?? string.Empty);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Replace any incorrect directory characters
|
||||||
|
if (Path.DirectorySeparatorChar == '\\')
|
||||||
|
fileName = fileName.Replace('/', '\\');
|
||||||
|
else if (Path.DirectorySeparatorChar == '/')
|
||||||
|
fileName = fileName.Replace('\\', '/');
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// If the full output path doesn't exist, create it
|
// If the full output path doesn't exist, create it
|
||||||
|
|||||||
Reference in New Issue
Block a user