@@ -1,9 +1,9 @@ # # Copyright (C) 1997-2000 Matt Newman # -# $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.tcl,v 1.8 2007/02/28 23:33:41 patthoyts Exp $ +# $Header: /home/rkeene/tmp/cvs2fossil/../tcltls/tls/tls/tls.tcl,v 1.9 2008/03/18 00:40:37 hobbs2 Exp $ # namespace eval tls { variable logcmd tclLog variable debug 0 @@ -18,10 +18,26 @@ variable socketCmd if {![info exists socketCmd]} { set socketCmd [info command ::socket] } } + +proc tls::initlib {dir dll} { + # Package index cd's into the package directory for loading. + # Irrelevant to unixoids, but for Windows this enables the OS to find + # the dependent DLL's in the CWD, where they may be. + set cwd [pwd] + catch {cd $dir} + set res [catch {load [file join $dir $dll]} err] + catch {cd $cwd} + if {$res} { + namespace delete tls + return -code $res $err + } + rename tls::initlib {} +} + # # Backwards compatibility, also used to set the default # context options # proc tls::init {args} {