From 84fa1e6dcfd96c948d28631c761fae53e8683af4 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Jan 2002 17:54:52 +0000 Subject: * generic/tclMain.c: Bug fix: neglected the NULL case in TclGetStartupScriptFileName(). Broke Tk/wish. --- ChangeLog | 6 +++++- generic/tclMain.c | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ec7a98..9ee2ed9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ -2002-01-05 Don Porter +2002-01-07 Don Porter + + * generic/tclMain.c: Bug fix: neglected the NULL case in + TclGetStartupScriptFileName(). Broke Tk/wish. +2002-01-05 Don Porter * doc/Tcl_Main.3: * generic/tclMain.c: Substantial rewrite and expanded documentation of Tcl_Main to correct a number of bugs and flaws: diff --git a/generic/tclMain.c b/generic/tclMain.c index 0678e3f..05b8278 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMain.c,v 1.15 2002/01/05 22:55:52 dgp Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.16 2002/01/07 17:54:52 dgp Exp $ */ #include "tcl.h" @@ -175,7 +175,12 @@ void TclSetStartupScriptFileName(fileName) */ CONST char *TclGetStartupScriptFileName() { - return Tcl_GetString(TclGetStartupScriptPath()); + Tcl_Obj *pathPtr = TclGetStartupScriptPath(); + + if (pathPtr == NULL) { + return NULL; + } + return Tcl_GetString(pathPtr); } -- cgit v0.12