diff --git a/ChangeLog b/ChangeLog index 66b79d950a..2cd5cf182b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Dec 10 23:58:30 2013 Nobuyoshi Nakada + + * 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] + Tue Dec 10 23:44:42 2013 Nobuyoshi Nakada * array.c (rb_ary_hash): add salt to differentiate false and empty 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;