* io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)
* io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio weird behavior. [ruby-dev:22424] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c3b99cc6f3
commit
5a8d60bf7f
@ -1,3 +1,10 @@
|
|||||||
|
Thu Jan 15 12:58:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (argf_read): do not append EOF. (ruby-bugs-ja:PR#585)
|
||||||
|
|
||||||
|
* io.c (rb_io_fwrite): ad-hockery hack to get rid of HP-UX stdio
|
||||||
|
weird behavior. [ruby-dev:22424]
|
||||||
|
|
||||||
Wed Jan 14 21:13:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Jan 14 21:13:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* test/inlinetest.rb (InlineTest::eval_part): eval under the top
|
* test/inlinetest.rb (InlineTest::eval_part): eval under the top
|
||||||
|
7
io.c
7
io.c
@ -394,8 +394,11 @@ rb_io_fwrite(ptr, len, f)
|
|||||||
}
|
}
|
||||||
} while (--n > 0);
|
} while (--n > 0);
|
||||||
#else
|
#else
|
||||||
while (ptr += (r = fwrite(ptr, 1, n, f)), (n -= r) > 0) {
|
while (errno = 0, ptr += (r = fwrite(ptr, 1, n, f)), (n -= r) > 0) {
|
||||||
if (ferror(f)) {
|
if (ferror(f)) {
|
||||||
|
#ifdef __hpux
|
||||||
|
if (!errno) errno = EAGAIN;
|
||||||
|
#endif
|
||||||
if (rb_io_wait_writable(fileno(f))) {
|
if (rb_io_wait_writable(fileno(f))) {
|
||||||
clearerr(f);
|
clearerr(f);
|
||||||
continue;
|
continue;
|
||||||
@ -4939,7 +4942,7 @@ argf_read(argc, argv)
|
|||||||
tmp = io_read(argc, argv, current_file);
|
tmp = io_read(argc, argv, current_file);
|
||||||
}
|
}
|
||||||
if (NIL_P(str)) str = tmp;
|
if (NIL_P(str)) str = tmp;
|
||||||
else rb_str_append(str, tmp);
|
else if (!NIL_P(tmp)) rb_str_append(str, tmp);
|
||||||
if (NIL_P(tmp) || NIL_P(length)) {
|
if (NIL_P(tmp) || NIL_P(length)) {
|
||||||
if (next_p != -1) {
|
if (next_p != -1) {
|
||||||
argf_close(current_file);
|
argf_close(current_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user