summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-11-03 12:59:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-11-03 12:59:07 (GMT)
commitd8596e5583d20147b85d5ccfba213628abb2b5e8 (patch)
tree71444b3103590c16067a2ce975795cc7585db007 /win
parent785f1059e494bc876676f93e06a6d66c4f87525c (diff)
parent5528e1c1a25f45988be72e2e16ff577f0dbb1abd (diff)
downloadtcl-d8596e5583d20147b85d5ccfba213628abb2b5e8.zip
tcl-d8596e5583d20147b85d5ccfba213628abb2b5e8.tar.gz
tcl-d8596e5583d20147b85d5ccfba213628abb2b5e8.tar.bz2
merge core-8-6-branch
Diffstat (limited to 'win')
-rw-r--r--win/tclWinLoad.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index 27eb8f3..69263e9 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -63,7 +63,7 @@ TclpDlopen(
* file. */
int flags)
{
- HINSTANCE hInstance;
+ HINSTANCE hInstance = NULL;
const TCHAR *nativeName;
Tcl_LoadHandle handlePtr;
DWORD firstError;
@@ -75,7 +75,10 @@ TclpDlopen(
*/
nativeName = Tcl_FSGetNativePath(pathPtr);
- hInstance = LoadLibraryEx(nativeName,NULL,LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (nativeName != NULL) {
+ hInstance = LoadLibraryEx(nativeName, NULL,
+ LOAD_WITH_ALTERED_SEARCH_PATH);
+ }
if (hInstance == NULL) {
/*
* Let the OS loader examine the binary search path for whatever
@@ -89,7 +92,8 @@ TclpDlopen(
* Remember the first error on load attempt to be used if the
* second load attempt below also fails.
*/
- firstError = GetLastError();
+ firstError = (nativeName == NULL) ?
+ ERROR_MOD_NOT_FOUND : GetLastError();
nativeName = Tcl_WinUtfToTChar(Tcl_GetString(pathPtr), -1, &ds);
hInstance = LoadLibraryEx(nativeName, NULL,