diff options
author | Erich Eckner <git@eckner.net> | 2016-03-10 13:59:29 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-03-15 13:01:16 +0100 |
commit | 33909e59e3e5f4b6d3c8489edb7e02c239688af2 (patch) | |
tree | ece7d7c08e1d57982525f45396947fad82ce1458 | |
parent | 671edf5cd4e3d6ed645cae071e252fac45bcce7b (diff) | |
download | units-33909e59e3e5f4b6d3c8489edb7e02c239688af2.tar.xz |
unfoldMacros ruft nun auch shellExpand auf in mystringlistunit.pas
-rw-r--r-- | mystringlistunit.pas | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mystringlistunit.pas b/mystringlistunit.pas index 7b91f75..3f49b0b 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -32,8 +32,7 @@ type function stillNeed(bez: string): boolean; function needInLine(bez: string; lin: longint): boolean; procedure insert(index: longint; const s: ansistring); override; - function unfoldMacros: boolean; overload; inline; - function unfoldMacros(kvs: tKnownValues; cbgv: tCallBackGetValue): boolean; overload; + function unfoldMacros(kvs: tKnownValues = nil; cbgv: tCallBackGetValue = nil): boolean; procedure subst(regex,ersatz: string); procedure dump(pro: tProtokollant; prefix: string); procedure nichtInSubRoutine(s: string); @@ -248,11 +247,6 @@ begin if index<=line then inc(line); end; -function tMyStringlist.unfoldMacros: boolean; -begin - result:=unfoldMacros(nil,nil); -end; - function tMyStringlist.unfoldMacros(kvs: tKnownValues; cbgv: tCallBackGetValue): boolean; var i,j,k,l,Ebene: longint; @@ -315,7 +309,14 @@ begin end; inc(i); end; - if wasGefunden then continue; + + for i:=0 to count-1 do begin // Shellvariablen auswerten + s:=shellExpand(self[i]); + if s<>self[i] then begin + wasGefunden:=true; + self[i]:=s; + end; + end; i:=count-1; while i>=0 do begin // Substitutionen auswerten @@ -392,7 +393,7 @@ begin s:=trim(s); while length(s)>0 do begin // Schleifenzähler laufen lassen - u:=erstesArgument(s); + u:=unEscape(erstesArgument(s)); for j:=0 to SchleifenInhalt.Count-1 do begin // Schleifenkörper ... v:=SchleifenInhalt[j]; k:=length(v); |