From 334294d0e2d42ba233672a66b8c670d6f933da2f Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 9 Dec 2013 02:14:35 +0000 Subject: date_parse.c: get rid of backtrack explosion * ext/date/date_parse.c (parse_time): unset case-insensitive flag for [:alpha:], which already implies both cases, to get rid of backtrack explosion. [ruby-core:58876] [Bug #9221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/date/date_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/date') diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index 29dbb239bb..3003b45239 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -765,9 +765,9 @@ parse_time(VALUE str, VALUE hash) "(" "(?:gmt|utc?)?[-+]\\d+(?:[,.:]\\d+(?::\\d+)?)?" "|" - "[[:alpha:].\\s]+(?:standard|daylight)\\stime\\b" + "(?-i:[[:alpha:].\\s]+)(?:standard|daylight)\\stime\\b" "|" - "[[:alpha:]]+(?:\\sdst)?\\b" + "(?-i:[[:alpha:]]+)(?:\\sdst)?\\b" ")" ")?"; static VALUE pat = Qnil; -- cgit v1.2.3