summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclMain.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c
index de745bd..a26577e 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -288,7 +288,6 @@ Tcl_MainEx(
* but before starting to execute commands. */
Tcl_Interp *interp)
{
- char *progname = NULL; /* may/may-not be able to use argv[0] */
int i=0; /* argv[i] index */
Tcl_Obj *path, *resultPtr, *argvPtr, *appName;
const char *encodingName = NULL;
@@ -299,13 +298,12 @@ Tcl_MainEx(
TclpSetInitialEncodings();
if (0 < argc) {
- progname = argv[0];
--argc; /* consume argv[0] */
++i;
}
- TclpFindExecutable ((const char *)progname); /* nb: this could be NULL
- * w/ (eg) a malformed
- * execve() */
+ TclpFindExecutable ((const char *)argv [0]); /* nb: this could be NULL
+ * w/ (eg) an empty argv
+ * supplied to execve() */
Tcl_InitMemory(interp);
@@ -345,7 +343,7 @@ Tcl_MainEx(
path = Tcl_GetStartupScript(&encodingName);
if (path == NULL) {
- appName = NewNativeObj(progname);
+ appName = NewNativeObj(argv[0]);
} else {
appName = path;
}