Piotr Caban : shell32: Improved equal ITEMIDLISTs handling in ILIsParent.
Alexandre Julliard
julliard at winehq.org
Thu Apr 7 07:36:47 CDT 2011
Module: wine
Branch: stable
Commit: 7f3953d4b8b567d36d8dfaf222171ba17f2b0829
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7f3953d4b8b567d36d8dfaf222171ba17f2b0829
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Jan 6 00:01:28 2011 +0100
shell32: Improved equal ITEMIDLISTs handling in ILIsParent.
(cherry picked from commit 92ba2168fa2b46a077f3d7746ce70ad6e815a7b2)
---
dlls/shell32/pidl.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index dffa2bd..f1f89a2 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -544,6 +544,8 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
* parent = a/b, child = a/b/c -> true, c is in folder a/b
* child = a/b/c/d -> false if bImmediate is true, d is not in folder a/b
* child = a/b/c/d -> true if bImmediate is false, d is in a subfolder of a/b
+ * child = a/b -> false if bImmediate is true
+ * child = a/b -> true if bImmediate is false
*/
BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
{
@@ -569,12 +571,12 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL b
pChild = ILGetNext(pChild);
}
- /* child shorter or has equal length to parent */
- if (pParent->mkid.cb || !pChild->mkid.cb)
+ /* child has shorter name than parent */
+ if (pParent->mkid.cb)
return FALSE;
/* not immediate descent */
- if ( ILGetNext(pChild)->mkid.cb && bImmediate)
+ if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
return FALSE;
return TRUE;
More information about the wine-cvs
mailing list