From 3d7bf1029eb09abfcd004d60ebe2f0b0b7b2b0d4 Mon Sep 17 00:00:00 2001 From: Sekulum Forka Date: Mon, 17 May 2021 17:06:37 +0200 Subject: [PATCH] Variables: evalVariables goes threw the frames in the right order now (from the most local frame to the global one) --- src/fsh.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fsh.nim b/src/fsh.nim index 51fd803..3787401 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -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]