aboutsummaryrefslogtreecommitdiff
path: root/jimsh.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-01-24 10:40:18 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:39 +1000
commit16360e9b8aded842ab0d343969eb13354750b5bb (patch)
treede8e8c532fa5e28804360919f0a651a2be8650cf /jimsh.c
parentb6cb7fb49a02a24d4c9435d3c010bb1606c3d6fe (diff)
downloadjimtcl-16360e9b8aded842ab0d343969eb13354750b5bb.zip
jimtcl-16360e9b8aded842ab0d343969eb13354750b5bb.tar.gz
jimtcl-16360e9b8aded842ab0d343969eb13354750b5bb.tar.bz2
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!
Diffstat (limited to 'jimsh.c')
-rw-r--r--jimsh.c3
1 files changed, 2 insertions, 1 deletions
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);
}
}