summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-12 08:45:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-12 08:45:02 +0000
commitcd948e46002a8e7fb8ff906e18a92da549669d81 (patch)
treebdef1013f70635636ea9135899ee1dbc3572c578
parent29b36962fe4b3cf08048c9b8e3a6dad258838eb0 (diff)
* struct.c (rb_struct_select): fix typo.
* io.c (io_write): check error if written data is less than specified size to detect EPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--io.c4
-rw-r--r--struct.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10abf4a300..90d6f4e700 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ Fri Apr 12 12:54:04 2002 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/config.h.in: define HAVE_COSH, HAVE_SINH, and HAVE_TANH.
+Fri Apr 12 02:58:55 2002 Koji Arai <jca02266@nifty.ne.jp>
+
+ * struct.c (rb_struct_select): fix typo.
+
Fri Apr 12 00:34:17 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* MANIFEST (missing/acosh.c): added.
@@ -17,6 +21,11 @@ Fri Apr 12 00:34:17 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* missing/acosh.c: added for acosh(), asinh() and atanh().
+Thu Apr 11 20:01:44 2002 Masahiro Tomita <tommy@tmtm.org>
+
+ * io.c (io_write): check error if written data is less than
+ specified size to detect EPIPE.
+
Thu Apr 11 19:10:37 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* io.c (remain_size): IO#read returns "" if file.size == 0.
diff --git a/io.c b/io.c
index da93d45253..cb10187e2b 100644
--- a/io.c
+++ b/io.c
@@ -290,11 +290,11 @@ io_write(io, str)
break;
n = ptr - RSTRING(str)->ptr;
}
- if (n == 0 && ferror(f))
+ if (n != RSTRING(str)->len && ferror(f))
rb_sys_fail(fptr->path);
#else
n = fwrite(RSTRING(str)->ptr, 1, RSTRING(str)->len, f);
- if (n == 0 && ferror(f)) {
+ if (n != RSTRING(str)->len && ferror(f)) {
rb_sys_fail(fptr->path);
}
#endif
diff --git a/struct.c b/struct.c
index 7e97e170f5..083bc83fe4 100644
--- a/struct.c
+++ b/struct.c
@@ -540,7 +540,7 @@ rb_struct_select(argc, argv, s)
rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
}
for (i = 0; i < RSTRUCT(s)->len; i++) {
- if (RTEST(rb_yield(RARRAY(s)->ptr[i]))) {
+ if (RTEST(rb_yield(RSTRUCT(s)->ptr[i]))) {
rb_ary_push(result, RSTRUCT(s)->ptr[i]);
}
}