Skip to content

Commit

Permalink
fix 2-char prefix search for exact match
Browse files Browse the repository at this point in the history
  • Loading branch information
zcsahok committed Oct 30, 2023
1 parent eb09d16 commit b869696
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/dxcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,15 @@ int find_best_match(const char *call) {
/* first check if it has a unique 2-char prefix */
if (strlen(call) >= 2) {
int key = prefix_hash_key(call);
if (two_char_prefix_index[key] >= 0) {
return two_char_prefix_index[key];
w = two_char_prefix_index[key];
if (w >= 0) {
bool ok = true;
if (prefix_by_index(w)->exact) {
ok = (strcmp(prefix_by_index(w)->pfx, call) == 0);
}
if (ok) {
return w;
}
}
}

Expand Down

0 comments on commit b869696

Please sign in to comment.