diff --git a/projects/GKCore/GKCore/Lists/ListSource.cs b/projects/GKCore/GKCore/Lists/ListSource.cs index 132935cb7..fb244f9a1 100644 --- a/projects/GKCore/GKCore/Lists/ListSource.cs +++ b/projects/GKCore/GKCore/Lists/ListSource.cs @@ -249,12 +249,13 @@ protected bool IsMatchesMask(string str, string mask) #else - if (string.IsNullOrEmpty(mask) || mask == "*") { + bool any = false; + if (string.IsNullOrEmpty(mask) || (any = mask.Equals("*"))) { return true; } if (string.IsNullOrEmpty(str)) { - return false; + return any; } if (fMask != mask) { diff --git a/projects/GKCore/GKCore/SysUtils.cs b/projects/GKCore/GKCore/SysUtils.cs index 70b6b0ed5..b44999f81 100644 --- a/projects/GKCore/GKCore/SysUtils.cs +++ b/projects/GKCore/GKCore/SysUtils.cs @@ -557,15 +557,16 @@ public static unsafe bool MatchPattern(string expression, string name) { const int MATCHES_ARRAY_SIZE = 16; - if (name == null || name.Length == 0) { - return false; - } - // Special case by far the most common wild card search of * - if (expression == null || expression.Length == 0 || expression.Equals("*")) { + bool any = false; + if (expression == null || expression.Length == 0 || (any = expression.Equals("*"))) { return true; } + if (name == null || name.Length == 0) { + return any; + } + int exprLen = expression.Length; int starPos = expression.IndexOf('*', 1);