diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs index de993f9c65..201e145981 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs @@ -507,7 +507,9 @@ private static bool StringMatches(Substring str, InternedString matchTo) nextChar = str[++posInStr]; if (nextChar == '*') { - ////TODO: make sure we don't end up with ** here + // Collapse consecutive '*' so we don't end up with `**` semantics here. + while (posInStr + 1 < strLength && str[posInStr + 1] == '*') + ++posInStr; if (posInStr == strLength - 1) return true; // Wildcard at end of string so rest is matched.