summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-29 10:40:20 +0200
committerErich Eckner <git@eckner.net>2017-08-29 10:40:20 +0200
commite27c4eee1cf1aa3d8816dce5d5741959d393b3d1 (patch)
treeb94fd4dbf33a1b1391772c91128d6d6c1178cfe4
parente1860dcf185960c6fc3fcf5f7417b3814c55f50f (diff)
downloadunits-e27c4eee1cf1aa3d8816dce5d5741959d393b3d1.tar.xz
systemunit.pas: remove possible deadlock in shellSubst
-rw-r--r--systemunit.pas11
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;