summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-22 16:19:07 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-22 16:19:07 +0000
commit335a9ef2f8acd966fd4f70281584e1c2258e4664 (patch)
treea3fc35c7b4e1ea379b300e36ab5feb3ae1f9bb8c /ext
parentf79b8872ce8397a89366f67909555e4055b86f4a (diff)
merge revision(s) 42100: [Backport #8806]
* ext/date/date_parse.c (rfc2822_cb): check if wday is given, since it can be omitted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/date/date_parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 765f9a7292..29dbb239bb 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -2848,7 +2848,9 @@ rfc2822_cb(VALUE m, VALUE hash)
s[i] = rb_reg_nth_match(i, m);
}
- set_hash("wday", INT2FIX(day_num(s[1])));
+ if (!NIL_P(s[1])) {
+ set_hash("wday", INT2FIX(day_num(s[1])));
+ }
set_hash("mday", str2num(s[2]));
set_hash("mon", INT2FIX(mon_num(s[3])));
y = str2num(s[4]);