eval and execute: If a builtin has been found, continue onto the next command instead of executing the program by the same name
This commit is contained in:
parent
226c44c99c
commit
69a96bda1b
|
@ -253,6 +253,7 @@ proc execute(cmd: string): int =
|
|||
if progname in builtins:
|
||||
stdout.write(runBuiltin(progname, args))
|
||||
result = 0
|
||||
continue
|
||||
let ps = startProcess(progname, args=args, options={poUsePath, poParentStreams})
|
||||
result = ps.waitForExit
|
||||
ps.close
|
||||
|
@ -267,6 +268,7 @@ proc eval(cmd: string): string =
|
|||
let args = parsed[1..parsed.high]
|
||||
if progname in builtins:
|
||||
result = runBuiltin(progname, args)
|
||||
continue
|
||||
let ps = startProcess(progname, args=args, options={poUsePath})
|
||||
result=ps.outputStream.readAll
|
||||
ps.close
|
||||
|
|
Loading…
Reference in New Issue