From e27c4eee1cf1aa3d8816dce5d5741959d393b3d1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 29 Aug 2017 10:40:20 +0200 Subject: systemunit.pas: remove possible deadlock in shellSubst --- systemunit.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/systemunit.pas b/systemunit.pas index 9b054ca..a10229b 100644 --- a/systemunit.pas +++ b/systemunit.pas @@ -126,12 +126,13 @@ function shellSubst(s: string): string; var name: string; begin - result:=s; - while pos('${',result)>0 do begin - s:=erstesArgument(result,'${',false); - name:=erstesArgument(result,'}',false); - result:=s+getEnvironmentVariable(name)+result; + result:=''; + while pos('${',s)>0 do begin + result:=result+erstesArgument(s,'${',false); + name:=erstesArgument(s,'}',false); + result:=result+getEnvironmentVariable(name); end; + result:=result+s; end; function homeVerzeichnis: string; -- cgit v1.2.3-70-g09d2