From 66d104394fc153c931741904e34d6d400d52ae25 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 30 Jan 2017 09:35:59 -0500 Subject: [PATCH] Add comments around cwd handling --- osu.Desktop/Program.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index db40f31c6f..b789c31777 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -26,14 +26,16 @@ public static class Program public static int Main(string[] args) { LegacyFilesystemReader.Register(); - - var cwd = Directory.GetCurrentDirectory(); + + // Back up the cwd before DesktopGameHost changes it + var cwd = Environment.CurrentDirectory; using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance) { var importer = new BeatmapImporter(host); + // Restore the cwd so relative paths given at the command line work correctly Directory.SetCurrentDirectory(cwd); foreach (var file in args) {