summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 18:48:49 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 18:48:49 +0000
commitef61d714f3d1ef8652935fc95776e7e0f93fdb07 (patch)
treea271780a4c04b53d1db1969d7fad9ac17723dfec /ext
parent11fe8c971570e554c916c4085025909d9149346f (diff)
merge revision(s) 44086,44126: [Backport #9221]
* 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] * 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/branches/ruby_2_0_0@44306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/date/date_parse.c4
-rw-r--r--ext/date/date_strptime.c4
2 files changed, 4 insertions, 4 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;
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index c6a5969172..3e1b0f85ea 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;