Skip to content

Commit

Permalink
Fix case-insensitive search for O, I, and l characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
samr7 committed Jul 26, 2012
1 parent c21e99a commit 5dc518a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,9 +1511,9 @@ static const unsigned char b58_case_map[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 105, 1, 1, 0, 1, 1, 111,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 76, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
};

Expand All @@ -1531,6 +1531,10 @@ prefix_case_iter_init(prefix_case_iter_t *cip, const char *pfx)
cip->ci_prefix[i] = pfx[i];
continue;
}
if (b58_case_map[(int)pfx[i]] > 1) {
cip->ci_prefix[i] = b58_case_map[(int)pfx[i]];
continue;
}
cip->ci_prefix[i] = pfx[i] | 0x20;
cip->ci_case_map[(int)cip->ci_nbits] = i;
cip->ci_nbits++;
Expand Down

0 comments on commit 5dc518a

Please sign in to comment.