From c3f59120dfa6be03678ffdcf5415adb0f80bc33d Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 8 Dec 2020 18:12:21 +0100 Subject: [PATCH] C#: Don't fail class/tree folder creation with invalid namespace names --- Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs index 4d6e8ce..e212dd4 100644 --- a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs +++ b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs @@ -292,7 +292,7 @@ namespace Il2CppInspector.Outputs var usings = nsRefs.OrderBy(n => (n.StartsWith("System.") || n == "System") ? "0" + n : "1" + n); // Ensure output directory exists and is not a file - var dir = Path.GetDirectoryName(outFile); + var dir = Regex.Replace(Path.GetDirectoryName(outFile), @"[<>:""\|\?\*]", "_"); if (!string.IsNullOrEmpty(dir)) { try { Directory.CreateDirectory(dir);