Skip to content

Commit

Permalink
Fix individuals without name are filtered out (fix #564)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Jun 7, 2024
1 parent 121f711 commit c6e9272
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions projects/GKCore/GKCore/Lists/ListSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 6 additions & 5 deletions projects/GKCore/GKCore/SysUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c6e9272

Please sign in to comment.