Commit 90c3c89a authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed regression in DPA_Search.

parent 068fa0aa
...@@ -815,8 +815,7 @@ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart, ...@@ -815,8 +815,7 @@ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
else /* (n > 0) */ else /* (n > 0) */
l = x + 1; l = x + 1;
} }
if (uOptions & (DPAS_INSERTBEFORE|DPAS_INSERTAFTER)) return l;
return l;
} }
else { else {
/* array is not sorted --> use linear search */ /* array is not sorted --> use linear search */
......
...@@ -307,6 +307,10 @@ static void test_dpa(void) ...@@ -307,6 +307,10 @@ static void test_dpa(void)
i = pDPA_Search(dpa, (PVOID)3, 0, i = pDPA_Search(dpa, (PVOID)3, 0,
CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE); CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE);
ok(i == 2, "i=%d\n", i); ok(i == 2, "i=%d\n", i);
/* without DPAS_INSERTBEFORE/AFTER */
i = pDPA_Search(dpa, (PVOID)3, 0,
CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
ok(i == -1, "i=%d\n", i);
/* Re-insert the item */ /* Re-insert the item */
ret = pDPA_InsertPtr(dpa, 2, (PVOID)3); ret = pDPA_InsertPtr(dpa, 2, (PVOID)3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment