diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-15 04:03:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-15 04:03:15 +0000 |
commit | 61fe8a94fb931ef08e87ae5a9721a377176036b0 (patch) | |
tree | be371935b8319351192a8feae8357483829d3529 /io.c | |
parent | 993b47fde40f9742f1ecbabb4f6729f94c1275fb (diff) | |
download | ruby-61fe8a94fb931ef08e87ae5a9721a377176036b0.tar.gz ruby-61fe8a94fb931ef08e87ae5a9721a377176036b0.tar.xz ruby-61fe8a94fb931ef08e87ae5a9721a377176036b0.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@5467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -394,8 +394,11 @@ rb_io_fwrite(ptr, len, f) } } while (--n > 0); #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)) { +#ifdef __hpux + if (!errno) errno = EAGAIN; +#endif if (rb_io_wait_writable(fileno(f))) { clearerr(f); continue; @@ -4939,7 +4942,7 @@ argf_read(argc, argv) tmp = io_read(argc, argv, current_file); } 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 (next_p != -1) { argf_close(current_file); |