From afcd11631af6e5f4c7c6ef1a94ac294423f64399 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 30 Apr 2012 17:15:01 +0000 Subject: [PATCH] LazUtils: Make ForceDirectoriesUTF8 more readable. git-svn-id: trunk@37108 - --- components/lazutils/fileutil.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/lazutils/fileutil.inc b/components/lazutils/fileutil.inc index a7dbe2a199..e4ac0f4fd2 100644 --- a/components/lazutils/fileutil.inc +++ b/components/lazutils/fileutil.inc @@ -1578,10 +1578,12 @@ function ForceDirectoriesUTF8(const Dir: string): Boolean; APath := ExtractFilePath(ADir); //this can happen on Windows if user specifies Dir like \user\name/test/ //and would, if not checked for, cause an infinite recusrsion and a stack overflow - if (APath = ADir) then Result := False - else Result:=DoForceDirectories(APath); - If Result then - Result := CreateDirUTF8(ADir); + if (APath = ADir) then + Result := False + else + Result:=DoForceDirectories(APath); + if Result then + Result := CreateDirUTF8(ADir); end; end;