Variables: 2 dollarsignsin a row are equal to a single dollarsign now

This commit is contained in:
Sekulum Forka 2021-05-16 16:50:19 +02:00
parent 0d8354ddd9
commit eff52bf920
1 changed files with 2 additions and 0 deletions

View File

@ -179,6 +179,7 @@ proc readVariable(strm: Stream): string =
result.add(strm.readSubstitution())
of ']', '}':
stderr.write("Unexpected " & c & ".\n")
of '$': result = "$"
else:
result.add(c)
while not strm.atEnd():
@ -189,6 +190,7 @@ proc readVariable(strm: Stream): string =
# evalVariable finds a value of a variable
proc evalVariable(vari: string): string =
if vari == "$": return "$"
if shellVariables.hasKey(vari):
result=shellVariables[vari]
elif envVariables.hasKey(vari):