[前][次][番号順一覧][スレッド一覧]

ruby-changes:10848

From: shyouhei <ko1@a...>
Date: Wed, 18 Feb 2009 22:31:54 +0900 (JST)
Subject: [ruby-changes:10848] Ruby:r22418 (ruby_1_8_7): merge revision(s) 20540:

shyouhei	2009-02-18 22:28:06 +0900 (Wed, 18 Feb 2009)

  New Revision: 22418

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22418

  Log:
    merge revision(s) 20540:
    * win32/win32.c (rb_w32_isatty): check whether fd is valid.

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/version.h
    branches/ruby_1_8_7/win32/win32.c

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 22417)
+++ ruby_1_8_7/ChangeLog	(revision 22418)
@@ -1,3 +1,7 @@
+Wed Feb 18 22:28:00 2009  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (rb_w32_isatty): check whether fd is valid.
+
 Wed Feb 18 22:24:23 2009  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (waitpid): fix bug of checking child slot.
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 22417)
+++ ruby_1_8_7/version.h	(revision 22418)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2009-02-18"
 #define RUBY_VERSION_CODE 187
 #define RUBY_RELEASE_CODE 20090218
-#define RUBY_PATCHLEVEL 126
+#define RUBY_PATCHLEVEL 127
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_7/win32/win32.c
===================================================================
--- ruby_1_8_7/win32/win32.c	(revision 22417)
+++ ruby_1_8_7/win32/win32.c	(revision 22418)
@@ -4088,6 +4088,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/

[前][次][番号順一覧][スレッド一覧]