summaryrefslogtreecommitdiff
path: root/jimsh.c
diff options
context:
space:
mode:
authoroharboe <oharboe>2009-08-16 11:26:28 +0000
committeroharboe <oharboe>2009-08-16 11:26:28 +0000
commitf754beb04b7c2aa88422aa42c6353f997bf523bc (patch)
tree857c8f1b4e905333b4f570b3cbc90fb34294e490 /jimsh.c
parentff7ab6e5a401cd728ab5a440659346bd50e0e9c9 (diff)
* jimsh.c: $argv0 should be the name of the script
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 862617c..d68098c 100644
--- a/jimsh.c
+++ b/jimsh.c
@@ -1,5 +1,6 @@
/* Jimsh - An interactive shell for Jim
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
+ * Copyright 2009 Steve Bennett <steveb@workware.net.au>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -146,7 +147,6 @@ int main(int argc, char *const argv[])
Jim_ListAppendElement(interp, listObj, obj);
}
- Jim_SetVariableStr(interp, "argv0", Jim_NewStringObj(interp, argv[0], -1));
Jim_SetVariableStr(interp, "argv", listObj);
if (argc == 1) {
@@ -154,6 +154,7 @@ int main(int argc, char *const argv[])
JimLoadJimRc(interp);
retcode = Jim_InteractivePrompt(interp);
} 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) {
Jim_PrintErrorMessage(interp);