https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ddc1a46456f6061c321a272aaa71bd4442c5edb6

commit ddc1a46456f6061c321a272aaa71bd4442c5edb6
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Sat Apr 11 11:55:06 2020 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Sat Apr 11 11:55:06 2020 +0900

    [SHELL32] Improve CChangeNotify::ShouldNotify more
    
    Improved non-recursive cases.
    CORE-13950
---
 dll/win32/shell32/shelldesktop/CChangeNotify.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dll/win32/shell32/shelldesktop/CChangeNotify.cpp 
b/dll/win32/shell32/shelldesktop/CChangeNotify.cpp
index 0692ff86989..910e664c8c1 100644
--- a/dll/win32/shell32/shelldesktop/CChangeNotify.cpp
+++ b/dll/win32/shell32/shelldesktop/CChangeNotify.cpp
@@ -576,7 +576,9 @@ BOOL CChangeNotify::ShouldNotify(LPDELITICKET pTicket, 
LPNOTIFSHARE pShared)
         {
             PathAddBackslashW(szPath1);
             cch1 = lstrlenW(szPath1);
-            if (cch < cch1)
+            if (cch < cch1 &&
+                (pShared->fRecursive ||
+                 wcschr(&szPath1[cch], L'\\') == &szPath1[cch1 - 1]))
             {
                 szPath1[cch] = 0;
                 if (lstrcmpiW(szPath, szPath1) == 0)
@@ -588,7 +590,9 @@ BOOL CChangeNotify::ShouldNotify(LPDELITICKET pTicket, 
LPNOTIFSHARE pShared)
         {
             PathAddBackslashW(szPath2);
             cch2 = lstrlenW(szPath2);
-            if (cch < cch2)
+            if (cch < cch2 &&
+                (pShared->fRecursive ||
+                 wcschr(&szPath2[cch], L'\\') == &szPath2[cch2 - 1]))
             {
                 szPath2[cch] = 0;
                 if (lstrcmpiW(szPath, szPath2) == 0)

Reply via email to