From ed563f37858510a76dd6cdea3c1865966cb7dcd0 Mon Sep 17 00:00:00 2001 From: suresh Date: Wed, 1 Jul 1998 15:45:02 +0000 Subject: Changed variable name "tclAlternateInitScript" to "tclPreInitScript". Added error checking in in Tcl_Init() for pre-initialization script. --- unix/tclUnixInit.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 7d71544..091d287 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -52,13 +52,12 @@ static int initialized = 0; #include "tclInitScript.h" /* - * A pointer to a string that holds an alternate initialization script to the - * built-in initialization script defined in the file "generic/tclInitScript.h". - * The Tcl_Init() routine will evaluate this script if it contains a non-NULL - * value. + * A pointer to a string that holds an initialization script that if non-NULL + * is evaluated in Tcl_Init() prior to the the built-in initialization script + * that is defined in the file "generic/tclInitScript.h". */ -char * tclAlternateInitScript = NULL; +char * tclPreInitScript = NULL; /* * Static routines in this file: @@ -220,10 +219,12 @@ int Tcl_Init(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ { - if (tclAlternateInitScript != NULL) { - Tcl_Eval(interp, tclAlternateInitScript); + if (tclPreInitScript != NULL) { + if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) { + return (TCL_ERROR); + }; } - return Tcl_Eval(interp, initScript); + return(Tcl_Eval(interp, initScript)); } /* -- cgit v0.12