diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-04 09:21:29 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-04 09:21:29 +0000 |
| commit | 5cf9195fc083bdbe9d18373bd6c5ab0d217f54ef (patch) | |
| tree | 4e63e2b190317ba5c399e6fa9c68c8d32cc3abcb | |
| parent | 9fba8a4167394a21fd999eebde796a496386a495 (diff) | |
merges r22743 from trunk into ruby_1_9_1.
--
* lib/csv.rb: A patch from Madoka Yakamamoto to prevent an infinite
loop while reading some encodings.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@22762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/csv.rb | 4 |
2 files changed, 6 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Wed Mar 4 03:42:56 2009 James Edward Gray II <jeg2@ruby-lang.org> + + * lib/csv.rb: A patch from Madoka Yakamamoto to prevent an infinite + loop while reading some encodings. + Mon Mar 2 21:01:36 2009 Tanaka Akira <akr@fsij.org> * file.c: include fcntl.h for O_RDONLY on Solaris. diff --git a/lib/csv.rb b/lib/csv.rb index fd83fdc35..774f9c3ef 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -2282,9 +2282,7 @@ class CSV if @io.eof? or data.size >= bytes + 10 return data else - data += @io.read(1) until data.valid_encoding? or - @io.eof? or - data.size >= bytes + 10 + data += @io.read(1) retry end end |
