fix cd bug

This commit is contained in:
Aidan 2020-07-02 16:44:14 -07:00
parent a5f157dbd7
commit 1802bce604
No known key found for this signature in database
GPG key ID: 327711E983899316

View file

@ -24,7 +24,15 @@ import (
)
func cd(in *ast.Token, vt ast.VarTable, ft ast.FuncTable) *ast.Token {
in = in.Eval(ft, vt, false)
in = in.Eval(ft, vt, true)
if in == nil {
log.Log(log.ERR,
"arguments to cd evaluated to nil!",
"cd")
return nil
}
if in.Tag == ast.LIST {
log.Log(log.ERR, "Couldnt change dir to a list", "cd")
return nil