From 7f2348488f5de0abcddd37f54fa95f5ffe70c9a2 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ext/tcltklib/stubs.c | 6 ++++++ win32/win32.c | 3 +++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 656c41c96b..4aa94f7dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jul 30 15:24:07 2002 WATANABE Hirofumi + + * 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(). + Tue Jul 30 09:11:07 2002 Minero Aoki * eval.c (rb_thread_join_m): add parameter type declaration. diff --git a/ext/tcltklib/stubs.c b/ext/tcltklib/stubs.c index 69a5d6d3c0..0c9e9872d7 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); diff --git a/win32/win32.c b/win32/win32.c index 097aef0ce7..94e7c456ad 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -82,6 +82,9 @@ static int valid_filename(char *s); static void StartSockets (); static char *str_grow(struct RString *str, size_t new_size); static DWORD wait_events(HANDLE event, DWORD timeout); +#ifndef __BORLANDC__ +static int rb_w32_open_osfhandle(long osfhandle, int flags); +#endif char *NTLoginName; -- cgit v1.2.3