Eval execute: They now ignore empty commands or commands that only contain a single empty string

This commit is contained in:
Sekulum Forka 2021-05-14 17:28:11 +02:00
parent 8e21117986
commit 4cd90e368c
1 changed files with 2 additions and 2 deletions

View File

@ -289,7 +289,7 @@ proc execute(cmd: string): int =
let strm=cmd.newStringStream
while not strm.atEnd:
let parsed = strm.readCommand.parseCommand
if parsed == @[]:
if parsed == @[] or parsed == @[""]:
continue
let progname = parsed[0]
let args = parsed[1..parsed.high]
@ -310,7 +310,7 @@ proc eval(cmd: string): string =
let strm=cmd.newStringStream
while not strm.atEnd():
let parsed = strm.readCommand.parseCommand
if parsed == @[]:
if parsed == @[] or parsed == @[""]:
continue
let progname=parsed[0]
let args = parsed[1..parsed.high]