summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-03 18:43:53 +0000
committerjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-03 18:43:53 +0000
commit111c48e6117ef916b1154c76839f1b2a7dd9d8ed (patch)
tree7595db51e12c006fb8d9914affa3b6bd56eb4706
parent5371f5cb26d8c934c5065450b867eb33e4db3e00 (diff)
* lib/csv.rb: A patch from Madoka Yakamamoto to prevent an infinite
loop while reading some encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/csv.rb4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c000924a55..297fc78a00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
+
Wed Mar 4 00:54:43 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* lib/prime.rb (Prime::prime?): used to return a wrong answer.
diff --git a/lib/csv.rb b/lib/csv.rb
index fd83fdc354..774f9c3ef3 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