Skip to content

Commit

Permalink
* io.c (argf_read): should not terminate on empty string; wait
Browse files Browse the repository at this point in the history
  until real EOF.  [ruby-dev:21969]

* io.c (argf_read): should adjust length to read, when length is
  specified and read spans command line argument files.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Dec 3, 2003
1 parent ad27a14 commit 4f5976c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
Thu Dec 4 01:45:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>

* io.c (argf_read): should not terminate on empty string; wait
until real EOF. [ruby-dev:21969]

* io.c (argf_read): should adjust length to read, when length is
specified and read spans command line argument files.

Wed Dec 3 19:38:36 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>

* lib/drb/drb.rb: correct fcntl parameter. [ruby-dev:22120]
Expand Down
20 changes: 14 additions & 6 deletions io.c
Expand Up @@ -3828,16 +3828,24 @@ argf_read(argc, argv)
else {
tmp = io_read(argc, argv, current_file);
}
if (NIL_P(tmp) && next_p != -1) {
argf_close(current_file);
next_p = 1;
if (argc == 0) goto retry;
if (NIL_P(tmp)) {
if (next_p != -1) {
argf_close(current_file);
next_p = 1;
goto retry;
}
return str;
}
if (NIL_P(tmp) || RSTRING(tmp)->len == 0) return str;
else if (NIL_P(str)) str = tmp;
else rb_str_append(str, tmp);
if (argc == 0) goto retry;

if (argc == 1) {
if (RSTRING(str)->len < len) {
len -= RSTRING(str)->len;
argv[0] = INT2NUM(len);
goto retry;
}
}
return str;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/delegate.rb
Expand Up @@ -46,6 +46,7 @@ def self.#{method}(*args, &block)
end
end
end
alias initialize_methods initialize

def __getobj__
raise NotImplementedError, "need to define `__getobj__'"
Expand All @@ -55,7 +56,7 @@ def marshal_dump
__getobj__
end
def marshal_load(obj)
initialize(obj)
initialize_methods(obj)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/ruby/test_env.rb
Expand Up @@ -3,7 +3,7 @@
$KCODE = 'none'

class TestEnv < Test::Unit::TestCase
IGNORE_CASE = /djgpp|bccwin|mswin|mingw|emx/ =~ RUBY_PLATFORM
IGNORE_CASE = /djgpp|bccwin|mswin|mingw/ =~ RUBY_PLATFORM

def setup
@backup = ENV['test']
Expand Down

0 comments on commit 4f5976c

Please sign in to comment.