diff options
author | Erich Eckner <git@eckner.net> | 2017-08-29 10:40:20 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-08-29 10:40:20 +0200 |
commit | e27c4eee1cf1aa3d8816dce5d5741959d393b3d1 (patch) | |
tree | b94fd4dbf33a1b1391772c91128d6d6c1178cfe4 | |
parent | e1860dcf185960c6fc3fcf5f7417b3814c55f50f (diff) | |
download | units-e27c4eee1cf1aa3d8816dce5d5741959d393b3d1.tar.xz |
systemunit.pas: remove possible deadlock in shellSubst
-rw-r--r-- | systemunit.pas | 11 |
1 files 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; |