From 27d51215664b7b2f9e62f7e1fa14654b9e643865 Mon Sep 17 00:00:00 2001 From: eban Date: Tue, 30 Jul 2002 06:34:27 +0000 Subject: * ext/tcltklib/stubs.c (ruby_tcltk_stubs): win32_getenv returns the same address always, so allocate string by ruby_strdup. * win32/win32.c: prototype; rb_w32_open_osfhandle(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tcltklib/stubs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/tcltklib') diff --git a/ext/tcltklib/stubs.c b/ext/tcltklib/stubs.c index 69a5d6d3c..0c9e9872d 100644 --- a/ext/tcltklib/stubs.c +++ b/ext/tcltklib/stubs.c @@ -40,10 +40,16 @@ ruby_tcltk_stubs() char tk_name[20]; ruby_tcl_dll = getenv("RUBY_TCL_DLL"); +#if defined NT + if (ruby_tcl_dll) ruby_tcl_dll = ruby_strdup(ruby_tcl_dll); +#endif ruby_tk_dll = getenv("RUBY_TK_DLL"); if (ruby_tcl_dll && ruby_tk_dll) { tcl_dll = (DL_HANDLE)DL_OPEN(ruby_tcl_dll); tk_dll = (DL_HANDLE)DL_OPEN(ruby_tk_dll); +#if defined NT + ruby_xfree(ruby_tcl_dll); +#endif } else { snprintf(tcl_name, sizeof tcl_name, TCL_NAME, DLEXT); snprintf(tk_name, sizeof tk_name, TK_NAME, DLEXT); -- cgit