From 96208f716629eaa77ddccd432c3a567b3cead637 Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Mon, 20 Jul 2020 04:20:03 -0400 Subject: [PATCH] Fix directory separators Path.DirectorySeparatorChar is a forward slash on Linux/Unix, so it ended up preventing DECORATE and ZSCRIPT code from being loaded on Linux. --- Source/Core/ZDoom/DecorateParser.cs | 2 +- Source/Core/ZDoom/GldefsParser.cs | 2 +- Source/Core/ZDoom/MapinfoParser.cs | 2 +- Source/Core/ZDoom/ModeldefParser.cs | 2 +- Source/Core/ZDoom/ZScriptParser.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/ZDoom/DecorateParser.cs b/Source/Core/ZDoom/DecorateParser.cs index b2d6dd4b..b8cfb303 100755 --- a/Source/Core/ZDoom/DecorateParser.cs +++ b/Source/Core/ZDoom/DecorateParser.cs @@ -231,7 +231,7 @@ namespace CodeImp.DoomBuilder.ZDoom } //mxd. Backward slashes are not supported - if(filename.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture))) + if(filename.Contains("\\")) { ReportError("Only forward slashes are supported by ZDoom"); return false; diff --git a/Source/Core/ZDoom/GldefsParser.cs b/Source/Core/ZDoom/GldefsParser.cs index ca112e49..1ad376b2 100755 --- a/Source/Core/ZDoom/GldefsParser.cs +++ b/Source/Core/ZDoom/GldefsParser.cs @@ -805,7 +805,7 @@ namespace CodeImp.DoomBuilder.ZDoom } // Backward slashes are not supported - if(includelump.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture))) + if(includelump.Contains("\\")) { ReportError("Only forward slashes are supported by GZDoom"); return false; diff --git a/Source/Core/ZDoom/MapinfoParser.cs b/Source/Core/ZDoom/MapinfoParser.cs index 0edeb04d..fc4961d0 100755 --- a/Source/Core/ZDoom/MapinfoParser.cs +++ b/Source/Core/ZDoom/MapinfoParser.cs @@ -227,7 +227,7 @@ namespace CodeImp.DoomBuilder.ZDoom } // Backward slashes are not supported - if(includelump.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture))) + if(includelump.Contains("\\")) { ReportError("Only forward slashes are supported by ZDoom"); return false; diff --git a/Source/Core/ZDoom/ModeldefParser.cs b/Source/Core/ZDoom/ModeldefParser.cs index 6303b938..facb51a0 100755 --- a/Source/Core/ZDoom/ModeldefParser.cs +++ b/Source/Core/ZDoom/ModeldefParser.cs @@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.ZDoom } //mxd. Backward slashes are not supported - if (filename.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture))) + if (filename.Contains("\\")) { ReportError("Only forward slashes are supported by ZDoom"); return false; diff --git a/Source/Core/ZDoom/ZScriptParser.cs b/Source/Core/ZDoom/ZScriptParser.cs index 14abfdea..3f3125c7 100755 --- a/Source/Core/ZDoom/ZScriptParser.cs +++ b/Source/Core/ZDoom/ZScriptParser.cs @@ -273,7 +273,7 @@ namespace CodeImp.DoomBuilder.ZDoom } //mxd. Backward slashes are not supported - if (filename.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture))) + if (filename.Contains("\\")) { ReportError("Only forward slashes are supported by ZDoom"); return false;