summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2025-09-23 10:25:04 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2025-09-23 10:25:04 (GMT)
commitfe630e70816bac05148415d429920697fd4f7cef (patch)
treee1e27e0d98114c7e0eac2a53c5bb310552c123ad /unix/tclUnixInit.c
parentf5e1c0c4101b76d5967bdc349985df90ac467555 (diff)
parentb74718ee37115ce70b36b70a6fd197b8ff86857c (diff)
downloadtcl-fe630e70816bac05148415d429920697fd4f7cef.zip
tcl-fe630e70816bac05148415d429920697fd4f7cef.tar.gz
tcl-fe630e70816bac05148415d429920697fd4f7cef.tar.bz2
Bug [c9e68eb6ca] - check result of getenv/GetEnvironmentVariable
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index c7de6a8..8c16d74 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -479,8 +479,10 @@ TclpInitLibraryPath(
*/
str = getenv("TCL_LIBRARY"); /* INTL: Native. */
- Tcl_ExternalToUtfDString(NULL, str, -1, &buffer);
- str = Tcl_DStringValue(&buffer);
+ if (str != NULL) {
+ Tcl_ExternalToUtfDString(NULL, str, -1, &buffer);
+ str = Tcl_DStringValue(&buffer);
+ }
if ((str != NULL) && (str[0] != '\0')) {
Tcl_DString ds;