temporary debugging instruction

This commit is contained in:
Massimo Melina 2020-05-14 13:03:58 +02:00
parent ef4340fc59
commit f68b6c23b5

View File

@ -1,4 +1,4 @@
{ {
Copyright (C) 2002-2014 Massimo Melina (www.rejetto.com) Copyright (C) 2002-2014 Massimo Melina (www.rejetto.com)
This file is part of HFS ~ HTTP File Server. This file is part of HFS ~ HTTP File Server.
@ -3050,7 +3050,7 @@ end; // recursiveApply
function Tfile.hasRecursive(attributes: TfileAttributes; orInsteadOfAnd:boolean=FALSE; outInherited:Pboolean=NIL):boolean; function Tfile.hasRecursive(attributes: TfileAttributes; orInsteadOfAnd:boolean=FALSE; outInherited:Pboolean=NIL):boolean;
var var
f: Tfile; f, p: Tfile;
begin begin
result:=FALSE; result:=FALSE;
f:=self; f:=self;
@ -3060,7 +3060,10 @@ while assigned(f) do
result:=orInsteadOfAnd and (attributes*f.flags <> []) result:=orInsteadOfAnd and (attributes*f.flags <> [])
or (attributes*f.flags = attributes); or (attributes*f.flags = attributes);
if result then exit; if result then exit;
f:=f.parent; p:=f.parent;
if f = p then // i noticed some hangs lately, possibly an infinite loop here. Trying to debug it
raise Exception.Create('invalid hierarchy '+f.name);
f:=p;
if assigned(outInherited) then outInherited^:=TRUE; if assigned(outInherited) then outInherited^:=TRUE;
end; end;
if assigned(outInherited) then outInherited^:=FALSE; // grant it is set only if result=TRUE if assigned(outInherited) then outInherited^:=FALSE; // grant it is set only if result=TRUE