summaryrefslogtreecommitdiffstats
path: root/generic/tclLoad.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-03-15 13:40:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-03-15 13:40:40 (GMT)
commit26e714137a987c67af5a932fdaf7bd1138d97a2d (patch)
tree9358f84805ded45680d28bba41db129dfafb91e2 /generic/tclLoad.c
parenta457b16dfc3bd4a4db9171364cd2a5ab04392bb8 (diff)
parentaa199edba612a516e6309290fb6dc4442a49a5ee (diff)
downloadtcl-26e714137a987c67af5a932fdaf7bd1138d97a2d.zip
tcl-26e714137a987c67af5a932fdaf7bd1138d97a2d.tar.gz
tcl-26e714137a987c67af5a932fdaf7bd1138d97a2d.tar.bz2
merge 8.7
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r--generic/tclLoad.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index bcda420..77e6425 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -130,7 +130,7 @@ Tcl_LoadObjCmd(
Tcl_PackageInitProc *initProc;
const char *p, *fullFileName, *packageName;
Tcl_LoadHandle loadHandle;
- Tcl_UniChar ch;
+ Tcl_UniChar ch = 0;
unsigned len;
int index, flags = 0;
Tcl_Obj *const *savedobjv = objv;
@@ -336,7 +336,7 @@ Tcl_LoadObjCmd(
}
#endif /* __CYGWIN__ */
for (p = pkgGuess; *p != 0; p += offset) {
- offset = Tcl_UtfToUniChar(p, &ch);
+ offset = TclUtfToUniChar(p, &ch);
if ((ch > 0x100)
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|| (UCHAR(ch) == '_'))) {
@@ -470,6 +470,19 @@ Tcl_LoadObjCmd(
*/
if (code != TCL_OK) {
+#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
+ Interp *iPtr = (Interp *) target;
+ if (iPtr->result && *(iPtr->result) && !iPtr->freeProc) {
+ /*
+ * A call to Tcl_InitStubs() determined the caller extension and
+ * this interp are incompatible in their stubs mechanisms, and
+ * recorded the error in the oldest legacy place we have to do so.
+ */
+ Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->result, -1));
+ iPtr->result = &tclEmptyString;
+ iPtr->freeProc = NULL;
+ }
+#endif /* defined(TCL_NO_DEPRECATED) */
Tcl_TransferResult(target, code, interp);
goto done;
}