diff options
Diffstat (limited to 'unix/tclUnixInit.c')
| -rw-r--r-- | unix/tclUnixInit.c | 8 |
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; |
