[5/8] scrrun: IEnumVARIANT::Next shouldn't fetch anything if asked number of folder elements is 0.

Dmitry Timoshkov dmitry at baikal.ru
Mon Jan 27 20:36:00 CST 2014


---
 dlls/scrrun/filesystem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 0292ab8..bc1cc79 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -509,6 +509,8 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
     if (fetched)
         *fetched = 0;
 
+    if (!celt) return S_OK;
+
     if (!handle)
     {
         handle = start_enumeration(This->data.u.foldercoll.coll->path, &data);
@@ -516,7 +518,7 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
 
         This->data.u.foldercoll.find = handle;
     }
-    else if (celt)
+    else
         FindNextFileW(handle, &data);
 
     do
-- 
1.8.5.3




More information about the wine-patches mailing list