From 7b625b2f6013bef2848d4e5adf06a6feecc8151a Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Thu, 30 Nov 2023 18:31:05 -0600 Subject: [PATCH] Use Path.DirectorySeparatorChar --- LANCommander.SDK/GameSaveManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LANCommander.SDK/GameSaveManager.cs b/LANCommander.SDK/GameSaveManager.cs index 5eb67d4..1b4fe28 100644 --- a/LANCommander.SDK/GameSaveManager.cs +++ b/LANCommander.SDK/GameSaveManager.cs @@ -67,7 +67,7 @@ namespace LANCommander.SDK bool inInstallDir = savePath.Path.StartsWith("{InstallDir}"); string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString()); - var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}\\", "")); + var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}" + Path.DirectorySeparatorChar, "")); destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory)); @@ -98,7 +98,7 @@ namespace LANCommander.SDK else { // Specified path is probably an absolute path, maybe with environment variables. - destination = Environment.ExpandEnvironmentVariables(file.Replace(tempSavePathFile, savePath.Path.Replace('/', '\\'))); + destination = Environment.ExpandEnvironmentVariables(file.Replace(tempSavePathFile, savePath.Path.Replace('/', Path.DirectorySeparatorChar))); if (File.Exists(destination)) File.Delete(destination);