Variables: evalVariables goes threw the frames in the right order now (from the most local frame to the global one)

This commit is contained in:
Sekulum Forka 2021-05-17 17:06:37 +02:00
parent 8c48eb9057
commit 3d7bf1029e
1 changed files with 2 additions and 1 deletions

View File

@ -192,7 +192,8 @@ proc readVariable(strm: Stream): string =
# evalVariable finds a value of a variable
proc evalVariable(vari: string): string =
if vari == "$": return "$"
for frame in shellVariables:
for i in shellVariables.high..shellVariables.low:
let frame = shellVariables[i]
if frame.hasKey(vari): return frame[vari]
if envVariables.hasKey(vari):
result = envVariables[vari]