From f68b6c23b5918d6b749ea8064d7e4b6766ac9341 Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Thu, 14 May 2020 13:03:58 +0200 Subject: [PATCH] temporary debugging instruction --- main.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.pas b/main.pas index 17ff5c9..bca816c 100644 --- a/main.pas +++ b/main.pas @@ -1,4 +1,4 @@ -{ +{ Copyright (C) 2002-2014 Massimo Melina (www.rejetto.com) 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; var - f: Tfile; + f, p: Tfile; begin result:=FALSE; f:=self; @@ -3060,7 +3060,10 @@ while assigned(f) do result:=orInsteadOfAnd and (attributes*f.flags <> []) or (attributes*f.flags = attributes); 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; end; if assigned(outInherited) then outInherited^:=FALSE; // grant it is set only if result=TRUE