parseCommand: Spaces at the beginning of a command should no longer make the shell crash
This commit is contained in:
parent
9568721c82
commit
226c44c99c
|
@ -191,6 +191,7 @@ proc parseCommand(cmd: string): seq[string] =
|
||||||
newitem.add(strm.readSubstitution.newStringStream.substitute)
|
newitem.add(strm.readSubstitution.newStringStream.substitute)
|
||||||
of '$': result.add(strm.readVariable.evalVariable)
|
of '$': result.add(strm.readVariable.evalVariable)
|
||||||
of ' ':
|
of ' ':
|
||||||
|
if (result == @[]) and (newitem == ""): continue
|
||||||
result.add(newitem)
|
result.add(newitem)
|
||||||
newitem = ""
|
newitem = ""
|
||||||
discard strm.skipSpaces()
|
discard strm.skipSpaces()
|
||||||
|
|
Loading…
Reference in New Issue