From 0b9b5022abcca41c8d61adabe3624baa0626fa72 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 16 Jun 2020 23:06:08 +0200 Subject: [PATCH] CLI: Fix regression causing Windows path search to fail --- Il2CppInspector.CLI/Utils.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.CLI/Utils.cs b/Il2CppInspector.CLI/Utils.cs index d64756d..173c2e8 100644 --- a/Il2CppInspector.CLI/Utils.cs +++ b/Il2CppInspector.CLI/Utils.cs @@ -16,7 +16,9 @@ namespace Il2CppInspector if (absolutePath.IndexOf("*", StringComparison.Ordinal) == -1) return absolutePath; - Regex sections = new Regex(string.Format(@"((?:[^*]*){0})((?:.*?)\*.*?)(?:$|{0})", Path.DirectorySeparatorChar)); + // Backslash is a special character when evaluating regexes so Windows path separator must be escaped... with a backslash + Regex sections = new Regex(string.Format(@"((?:[^*]*){0})((?:.*?)\*.*?)(?:$|{0})", + Path.DirectorySeparatorChar == '\\' ? @"\\" : Path.DirectorySeparatorChar.ToString())); var matches = sections.Matches(absolutePath); var pathLength = 0;