[#82311] [Ruby trunk Bug#13794] Infinite loop of sched_yield — charlie@...
Issue #13794 has been reported by catphish (Charlie Smurthwaite).
4 messages
2017/08/09
[#82518] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — mame@...
Issue #13618 has been updated by mame (Yusuke Endoh).
5 messages
2017/08/30
[#82552] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2017/08/31
mame@ruby-lang.org wrote:
[#82756] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wrong <normalperson@...>
2017/09/12
Eric Wrong <normalperson@yhbt.net> wrote:
[ruby-core:82436] [Ruby trunk Feature#9147] CSV.new option skip_lines should escape String before convert to Regexp
From:
hsbt@...
Date:
2017-08-22 05:29:19 UTC
List:
ruby-core #82436
Issue #9147 has been updated by hsbt (Hiroshi SHIBATA).
Assignee changed from JEG2 (James Gray) to hsbt (Hiroshi SHIBATA)
----------------------------------------
Feature #9147: CSV.new option skip_lines should escape String before convert to Regexp
https://bugs.ruby-lang.org/issues/9147#change-66244
* Author: nagachika (Tomoyuki Chikanaga)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version: 2.2.0
----------------------------------------
After r43823, the following script ignore all lines.
== test_csv.rb ==
```
require "csv"
csv = CSV.new(<<-EOL, skip_lines: ".")
1,foo
.2,bar
3,baz
EOL
p csv.each.to_a # => []
```
I think String value for skip_lines option should be escaped before convert to Regexp.
```
diff --git a/lib/csv.rb b/lib/csv.rb
index a4d8e3d..3e067f2 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -2127,7 +2127,7 @@ class CSV
# See also CSV.new
def init_comments(options)
@skip_lines = options.delete(:skip_lines)
- @skip_lines = Regexp.new(@skip_lines) if @skip_lines.is_a? String
+ @skip_lines = Regexp.new(Regexp.escape(@skip_lines)) if @skip_lines.is_a? String
if @skip_lines and not @skip_lines.respond_to?(:match)
raise ArgumentError, ":skip_lines has to respond to matches"
end
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>