summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:58:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-10 14:58:43 +0000
commit9a938987cb6b3ed3f0c7735f5b19b10f45694a3f (patch)
tree06cb833aaaa8f8e5b04f0d61a024f7c82f6ccd85 /ext/date
parent037a9d06559e25cce2368979cecba710ddb4765d (diff)
date_strptime.c: get rid of backtrack explosion
* ext/date/date_strptime.c (date__strptime_internal): unset case-insensitive flag for [:alpha:], which already implies both cases, to get rid of backtrack explosion. [ruby-core:58984] [Bug #9221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/date_strptime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index c6a5969..3e1b0f8 100644
--- a/ext/date/date_strptime.c
+++ b/ext/date/date_strptime.c
@@ -567,8 +567,8 @@ date__strptime_internal(const char *str, size_t slen,
static const char pat_source[] =
"\\A("
"(?:gmt|utc?)?[-+]\\d+(?:[,.:]\\d+(?::\\d+)?)?"
- "|[[:alpha:].\\s]+(?:standard|daylight)\\s+time\\b"
- "|[[:alpha:]]+(?:\\s+dst)?\\b"
+ "|(?-i:[[:alpha:].\\s]+)(?:standard|daylight)\\s+time\\b"
+ "|(?-i:[[:alpha:]]+)(?:\\s+dst)?\\b"
")";
static VALUE pat = Qnil;
VALUE m, b;