summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-04 08:16:56 +0200
committerGitHub <noreply@github.com>2020-09-04 08:16:56 +0200
commit15efe040f97c150679da80f3266abad3158dbddf (patch)
tree35f7ffd3c14f11507d8c0a0ea6abc5801261040f
parent90601bb65908a8d7a4e93f1790c68f3ad5be9fe9 (diff)
parent9e8a5e4b5a23b75ea7e3991371fb398af6d823de (diff)
Merge pull request #41747 from neikeq/issue-41446
Fix parsing of C# files with spaces in the path
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
index e6b0e8f1df..ae2dbbf58d 100644
--- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs
@@ -14,10 +14,11 @@ namespace GodotTools.Core
if (Path.DirectorySeparatorChar == '\\')
dir = dir.Replace("/", "\\") + "\\";
- Uri fullPath = new Uri(Path.GetFullPath(path), UriKind.Absolute);
- Uri relRoot = new Uri(Path.GetFullPath(dir), UriKind.Absolute);
+ var fullPath = new Uri(Path.GetFullPath(path), UriKind.Absolute);
+ var relRoot = new Uri(Path.GetFullPath(dir), UriKind.Absolute);
- return relRoot.MakeRelativeUri(fullPath).ToString();
+ // MakeRelativeUri converts spaces to %20, hence why we need UnescapeDataString
+ return Uri.UnescapeDataString(relRoot.MakeRelativeUri(fullPath).ToString());
}
public static string NormalizePath(this string path)