diff options
author | oharboe <oharboe> | 2009-08-16 11:26:28 +0000 |
---|---|---|
committer | oharboe <oharboe> | 2009-08-16 11:26:28 +0000 |
commit | f754beb04b7c2aa88422aa42c6353f997bf523bc (patch) | |
tree | 857c8f1b4e905333b4f570b3cbc90fb34294e490 /jimsh.c | |
parent | ff7ab6e5a401cd728ab5a440659346bd50e0e9c9 (diff) | |
download | jimtcl-f754beb04b7c2aa88422aa42c6353f997bf523bc.zip jimtcl-f754beb04b7c2aa88422aa42c6353f997bf523bc.tar.gz jimtcl-f754beb04b7c2aa88422aa42c6353f997bf523bc.tar.bz2 |
* jimsh.c: $argv0 should be the name of the script
Diffstat (limited to 'jimsh.c')
-rw-r--r-- | jimsh.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |