summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-09 02:14:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-09 02:14:35 +0000
commit334294d0e2d42ba233672a66b8c670d6f933da2f (patch)
tree1734c880cad1dd9c48089e5b6d9b8a00acf5f65c
parent05ba6fffcc6414e2940acf7c918821d832d7b30d (diff)
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
-rw-r--r--ChangeLog6
-rw-r--r--ext/date/date_parse.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 42e53bd98b..14d48cafac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Dec 9 11:14:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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]
+
Mon Dec 9 08:40:40 2013 Eric Hodel <drbrain@segment7.net>
* lib/rubygems: Update to RubyGems master bf37240. Fixes useless
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;