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 | db3825c05121caa63a8cde9b1d59aa6d79815734 (patch) | |
tree | 4745d1ad89693027ceaf29e391ba5bcb9974bf4b | |
parent | 669c6c8c8cda279ecd883d7fad00795644571905 (diff) | |
download | ruby-db3825c05121caa63a8cde9b1d59aa6d79815734.tar.gz ruby-db3825c05121caa63a8cde9b1d59aa6d79815734.tar.xz ruby-db3825c05121caa63a8cde9b1d59aa6d79815734.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/branches/ruby_1_8@5467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | io.c | 7 |
2 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Thu Jan 15 13:03:10 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 13:31:06 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/iconv/extconf.rb: wrapper iconv.rb is dependent on platform. @@ -393,8 +393,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; @@ -4938,7 +4941,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); |