summaryrefslogtreecommitdiffstats
path: root/generic/tkMain.c
diff options
context:
space:
mode:
authorredman <redman>1999-12-02 02:05:31 (GMT)
committerredman <redman>1999-12-02 02:05:31 (GMT)
commit47db144ca5053ea42c75249d1269230a1f3eb8fa (patch)
treeed0a121bdb6db0a3a36b7cd89a95be74a4409332 /generic/tkMain.c
parent0a8a3449f94769a8d0934f7cfefa9145a4a74df1 (diff)
downloadtk-47db144ca5053ea42c75249d1269230a1f3eb8fa.zip
tk-47db144ca5053ea42c75249d1269230a1f3eb8fa.tar.gz
tk-47db144ca5053ea42c75249d1269230a1f3eb8fa.tar.bz2
* generic/tkMain.c :
* unix/tkAppInit.c: * win/winMain.c: Added added hooks into the main() code for supporting TclPro and other "big" shells more easily without requiring a copy of the main() code.
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r--generic/tkMain.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c
index ce33f8a..a7b4bf8 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMain.c,v 1.5 1999/04/28 18:18:06 redman Exp $
+ * RCS: @(#) $Id: tkMain.c,v 1.6 1999/12/02 02:05:34 redman Exp $
*/
#include <ctype.h>
@@ -137,7 +137,8 @@ Tk_MainEx(argc, argv, appInitProc, interp)
* use it as the name of a script file to process.
*/
- fileName = NULL;
+ fileName = TclGetStartupScriptFileName();
+
if (argc > 1) {
length = strlen(argv[1]);
if ((length >= 2) && (strncmp(argv[1], "-file", length) == 0)) {
@@ -145,12 +146,14 @@ Tk_MainEx(argc, argv, appInitProc, interp)
argv++;
}
}
- if ((argc > 1) && (argv[1][0] != '-')) {
- fileName = argv[1];
- argc--;
- argv++;
+ if (fileName == NULL) {
+ if ((argc > 1) && (argv[1][0] != '-')) {
+ fileName = argv[1];
+ argc--;
+ argv++;
+ }
}
-
+
/*
* Make command-line arguments available in the Tcl variables "argc"
* and "argv".