ruby-changes:10846
From: shyouhei <ko1@a...>
Date: Wed, 18 Feb 2009 22:30:49 +0900 (JST)
Subject: [ruby-changes:10846] Ruby:r22416 (ruby_1_8_6): merge revision(s) 20540:
shyouhei 2009-02-18 22:27:18 +0900 (Wed, 18 Feb 2009) New Revision: 22416 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22416 Log: merge revision(s) 20540: * win32/win32.c (rb_w32_isatty): check whether fd is valid. Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/version.h branches/ruby_1_8_6/win32/win32.c Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 22415) +++ ruby_1_8_6/ChangeLog (revision 22416) @@ -1,3 +1,7 @@ +Wed Feb 18 22:27:11 2009 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_isatty): check whether fd is valid. + Wed Feb 18 22:23:44 2009 NAKAMURA Usaku <usa@r...> * win32/win32.c (waitpid): fix bug of checking child slot. Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 22415) +++ ruby_1_8_6/version.h (revision 22416) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-18" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090218 -#define RUBY_PATCHLEVEL 340 +#define RUBY_PATCHLEVEL 341 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_6/win32/win32.c =================================================================== --- ruby_1_8_6/win32/win32.c (revision 22415) +++ ruby_1_8_6/win32/win32.c (revision 22416) @@ -3911,6 +3911,10 @@ int rb_w32_isatty(int fd) { + // validate fd by using _get_osfhandle() because we cannot access _nhandle + if (_get_osfhandle(fd) == -1) { + return 0; + } if (!(_osfile(fd) & FOPEN)) { errno = EBADF; return 0; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/