REPL defers to sh when a symbol isn't found.
This commit is contained in:
parent
85d8ee73e7
commit
f48e1bf5c9
|
@ -618,10 +618,16 @@ void repl(struct Environment* env)
|
||||||
free(oldBuf);
|
free(oldBuf);
|
||||||
}
|
}
|
||||||
Object o = parseEval(buf, env);
|
Object o = parseEval(buf, env);
|
||||||
|
if (isError(o, DID_NOT_FIND_SYMBOL)) {
|
||||||
|
cleanObject(&o);
|
||||||
|
system(buf);
|
||||||
|
free(buf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
size_t length;
|
size_t length;
|
||||||
char *output = stringObj(&o, &length);
|
char* output = stringObj(&o, &length);
|
||||||
cleanObject(&o);
|
cleanObject(&o);
|
||||||
printColored(output);
|
printColored(output);
|
||||||
free(output);
|
free(output);
|
||||||
|
|
Loading…
Reference in New Issue