summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 08:21:58 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-02 08:21:58 +0000
commit727d746eaa6389c6992d72318ec004d2681a2efc (patch)
tree0059fe134daf4e2c2b856f01bff7269fd53925c0 /ext
parentcc15ebe00eee5110d0c2fcd722c3373c65baae4a (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_1_9_3@42774 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 903163003c..7c8267bbab 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -2147,7 +2147,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]);