summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2025-09-23 12:00:19 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2025-09-23 12:00:19 (GMT)
commit26235348694a0f6683da2232539e966a4a69d7df (patch)
treea788b5a6f1fc86973c5bfbdba844f0993bb36d71 /unix/tclUnixInit.c
parent7c6aafa73dceaadb3f407c14720da652cba9a66e (diff)
parent937f3434c1300404d5643a2943e5dfba734d4022 (diff)
downloadtcl-26235348694a0f6683da2232539e966a4a69d7df.zip
tcl-26235348694a0f6683da2232539e966a4a69d7df.tar.gz
tcl-26235348694a0f6683da2232539e966a4a69d7df.tar.bz2
Merge 8.6 - Fix [c9e68eb6ca] getenv checks
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 06f5249..b926a72 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -438,8 +438,12 @@ TclpInitLibraryPath(
*/
str = getenv("TCL_LIBRARY"); /* INTL: Native. */
- Tcl_ExternalToUtfDStringEx(NULL, NULL, str, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &buffer, NULL);
- str = Tcl_DStringValue(&buffer);
+ if (str != NULL) {
+ Tcl_ExternalToUtfDStringEx(NULL, NULL, str, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &buffer, NULL);
+ str = Tcl_DStringValue(&buffer);
+ } else {
+ Tcl_DStringInit(&buffer);
+ }
if ((str != NULL) && (str[0] != '\0')) {
Tcl_DString ds;