From 16360e9b8aded842ab0d343969eb13354750b5bb Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 24 Jan 2010 10:40:18 +1000 Subject: Fix a couple of bugs Fix unset ::var properly this time Ensure that jimsh exits with the correct exit code *: Previously a script that did 'exit 0' would exit with 7! --- jim.c | 1 + jimsh.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jim.c b/jim.c index 03fcb43..9b1f4d6 100644 --- a/jim.c +++ b/jim.c @@ -121,6 +121,7 @@ static char *JimEmptyStringRep = (char*) ""; * ---------------------------------------------------------------------------*/ static void JimChangeCallFrameId(Jim_Interp *interp, Jim_CallFrame *cf); static void JimFreeCallFrame(Jim_Interp *interp, Jim_CallFrame *cf, int flags); +static int ListSetIndex(Jim_Interp *interp, Jim_Obj *listPtr, int index, Jim_Obj *newObjPtr, int flags); static Jim_HashTableType JimVariablesHashTableType; diff --git a/jimsh.c b/jimsh.c index 464f943..d94668d 100644 --- a/jimsh.c +++ b/jimsh.c @@ -159,7 +159,8 @@ int main(int argc, char *const argv[]) } else { Jim_SetVariableStr(interp, "argv0", Jim_NewStringObj(interp, argv[1], -1)); Jim_SetVariableStrWithStr(interp, JIM_INTERACTIVE, "0"); - if ((retcode = Jim_EvalFile(interp, argv[1])) == JIM_ERR) { + retcode = Jim_EvalFile(interp, argv[1]); + if (retcode == JIM_ERR || retcode == JIM_ERR_ADDSTACK) { Jim_PrintErrorMessage(interp); } } -- cgit v1.1