diff options
author | Mike MacDonald <crazymykl@gmail.com> | 2019-11-02 23:48:22 -0400 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-20 02:32:49 +0900 |
commit | d57bc03ba98649661c7dedbb46ec2f2bb6bee9be (patch) | |
tree | 72fa6a8348b20e640eac893344209cf9d0700f86 /lib/csv | |
parent | b219cd5ac36ffb733e3eccd98d53ecf660dee5bf (diff) | |
download | ruby-d57bc03ba98649661c7dedbb46ec2f2bb6bee9be.tar.gz |
[ruby/csv] Do not loop forever when skip_lines regexp matches zero length with anchors (#110)
* Do not loop forever when skip_lines regexp matches zero length with anchors
* Remove needless white spaces
* Add missing eos check in skip_needless_lines
* Simplify test
https://github.com/ruby/csv/commit/3b15d4a3e8
Diffstat (limited to 'lib/csv')
-rw-r--r-- | lib/csv/parser.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb index 42145f8923..f30cfc6f76 100644 --- a/lib/csv/parser.rb +++ b/lib/csv/parser.rb @@ -769,7 +769,7 @@ class CSV def skip_needless_lines return unless @skip_lines - while true + until @scanner.eos? @scanner.keep_start line = @scanner.scan_all(@not_line_end) || "".encode(@encoding) line << @row_separator if parse_row_end |