Browse Source

Fix case-insensitive search for O, I, and l characters.

master
samr7 12 years ago
parent
commit
5dc518a683
  1. 8
      pattern.c

8
pattern.c

@ -1511,9 +1511,9 @@ static const unsigned char b58_case_map[256] = { @@ -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,
};
@ -1531,6 +1531,10 @@ prefix_case_iter_init(prefix_case_iter_t *cip, const char *pfx) @@ -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++;

Loading…
Cancel
Save