parseCommand: Spaces at the beginning of a command should no longer make the shell crash

This commit is contained in:
Sekulum Forka 2021-05-12 22:12:58 +02:00
parent 9568721c82
commit 226c44c99c
1 changed files with 1 additions and 0 deletions

View File

@ -191,6 +191,7 @@ proc parseCommand(cmd: string): seq[string] =
newitem.add(strm.readSubstitution.newStringStream.substitute)
of '$': result.add(strm.readVariable.evalVariable)
of ' ':
if (result == @[]) and (newitem == ""): continue
result.add(newitem)
newitem = ""
discard strm.skipSpaces()