summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadDl.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-09-04 21:35:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-09-04 21:35:21 (GMT)
commita50dcb923a50640e31a433c872caa63630d8202d (patch)
treeb5db0420431479a99a1a92ade263f2d177ff1e7f /unix/tclLoadDl.c
parent25925f6f8e072a0bc3cf719c7684eff79f96ed8f (diff)
parent4c8d436cd9e92ed6a304fed697f233ecb7996635 (diff)
downloadtcl-a50dcb923a50640e31a433c872caa63630d8202d.zip
tcl-a50dcb923a50640e31a433c872caa63630d8202d.tar.gz
tcl-a50dcb923a50640e31a433c872caa63630d8202d.tar.bz2
merge trunk
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r--unix/tclLoadDl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index d86e7fd..a48aa23 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -112,8 +112,9 @@ TclpDlopen(
const char *errorStr = dlerror();
- Tcl_AppendResult(interp, "couldn't load file \"",
- Tcl_GetString(pathPtr), "\": ", errorStr, NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "couldn't load file \"%s\": %s",
+ Tcl_GetString(pathPtr), errorStr));
return TCL_ERROR;
}
newHandle = ckalloc(sizeof(*newHandle));
@@ -175,9 +176,14 @@ FindSymbol(
}
Tcl_DStringFree(&ds);
if (proc == NULL && interp != NULL) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "cannot find symbol \"", symbol, "\": ",
- dlerror(), NULL);
+ const char *errorStr = dlerror();
+
+ if (!errorStr) {
+ errorStr = "unknown";
+ }
+
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "cannot find symbol \"%s\": %s", symbol, errorStr));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
NULL);
}