summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 12:45:13 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 12:45:13 +0000
commit57eb3170450a0374dd17b30eb77a26ee4560019a (patch)
tree25cbe0ce7a09f6a155b899d0c039342475d895e7
parent461b1452da6ff1bddb5c25af232ac79f3d9bfb22 (diff)
merges r30104 from trunk into ruby_1_9_2.
-- * win32/win32.c (rb_w32_read): fixed more for readline, and so on. [ruby-core:33511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--version.h2
-rw-r--r--win32/win32.c8
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index af8ea847ec..43c49c8ce9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 7 00:27:14 2010 Masaya Tarui <tarui@ruby-lnag.org>
+
+ * win32/win32.c (rb_w32_read): fixed more for readline,
+ and so on. [ruby-core:33511]
+
Mon Dec 6 18:56:42 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_string.rb (TestString#test_scan): add a test for
diff --git a/version.h b/version.h
index 830e6011e0..9a165eec67 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 119
+#define RUBY_PATCHLEVEL 120
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
diff --git a/win32/win32.c b/win32/win32.c
index 59310eaf14..4d647f9d8e 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5057,6 +5057,7 @@ rb_w32_read(int fd, void *buf, size_t size)
size_t ret;
OVERLAPPED ol, *pol = NULL;
BOOL isconsole;
+ BOOL islineinput;
int start = 0;
if (is_socket(sock))
@@ -5081,6 +5082,11 @@ rb_w32_read(int fd, void *buf, size_t size)
ret = 0;
isconsole = is_console(_osfhnd(fd));
+ if(isconsole){
+ DWORD mode;
+ GetConsoleMode((HANDLE)_osfhnd(fd),&mode);
+ islineinput = (mode & ENABLE_LINE_INPUT) != 0;
+ }
retry:
/* get rid of console reading bug */
if (isconsole) {
@@ -5183,7 +5189,7 @@ rb_w32_read(int fd, void *buf, size_t size)
ret += read;
if (read >= len) {
buf = (char *)buf + read;
- if (!(isconsole && len == 1 && *((char *)buf - 1) == '\n') && size > 0)
+ if (!(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
goto retry;
}
if (read == 0)