提交 04db39f1 编写于 作者: N Nikolai SAOUKH

Fix case folding name compare in btree code

Remove folding of 0x0000 char to invalid unicode char 0xFFFF.

Fix false match when name in the btree on disk is the prefix of longer search key.
上级 deb1d2c8
...@@ -1042,20 +1042,20 @@ fsw_hfs_cmpf_catkey (BTreeKey *btkey1, BTreeKey *btkey2) ...@@ -1042,20 +1042,20 @@ fsw_hfs_cmpf_catkey (BTreeKey *btkey1, BTreeKey *btkey2)
for (ac = 0; ac == 0 && apos < ckey1nlen; apos++) { for (ac = 0; ac == 0 && apos < ckey1nlen; apos++) {
ac = be16_to_cpu (p1[apos]); ac = be16_to_cpu (p1[apos]);
ac = ac ? fsw_to_lower (ac) : 0xFFFF; ac = fsw_to_lower (ac);
} }
/* get next valid character from ckey2 */ /* get next valid character from ckey2 */
for (bc = 0; bc == 0 && bpos < ckey2nlen; bpos++) { for (bc = 0; bc == 0 && bpos < ckey2nlen; bpos++) {
bc = p2[bpos]; bc = p2[bpos];
bc = bc ? fsw_to_lower (bc) : 0xFFFF; bc = fsw_to_lower (bc);
} }
if (ac != bc) if (ac != bc)
break; break;
if (bpos == ckey1nlen) if (ac == 0)
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册