瀏覽代碼

* only call findclose if findfirst succeeded

git-svn-id: trunk@25188 -
Jonas Maebe 12 年之前
父節點
當前提交
fcbc435435
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      compiler/cfileutl.pas

+ 2 - 2
compiler/cfileutl.pas

@@ -299,8 +299,8 @@ end;
                     DirectoryEntries.Add(Dir.Name,Pointer(Ptrint(Dir.Attr)));
                     DirectoryEntries.Add(Dir.Name,Pointer(Ptrint(Dir.Attr)));
                 end;
                 end;
             until findnext(dir) <> 0;
             until findnext(dir) <> 0;
+            findclose(dir);
           end;
           end;
-        findclose(dir);
       end;
       end;
 
 
 
 
@@ -1122,8 +1122,8 @@ end;
                         end;
                         end;
                     end;
                     end;
                 until findnext(dir) <> 0;
                 until findnext(dir) <> 0;
+                FindClose(dir);
               end;
               end;
-            FindClose(dir);
 {$endif usedircache}
 {$endif usedircache}
             if not subdirfound then
             if not subdirfound then
               WarnNonExistingPath(currpath);
               WarnNonExistingPath(currpath);