diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-09 02:14:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-09 02:14:35 +0000 |
commit | 334294d0e2d42ba233672a66b8c670d6f933da2f (patch) | |
tree | 1734c880cad1dd9c48089e5b6d9b8a00acf5f65c /ext/date | |
parent | 05ba6fffcc6414e2940acf7c918821d832d7b30d (diff) | |
download | ruby-334294d0e2d42ba233672a66b8c670d6f933da2f.tar.gz |
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
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/date_parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |