[macruby-changes] [4572] MacRuby/trunk/lib/date/format.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 4 15:47:48 PDT 2010


Revision: 4572
          http://trac.macosforge.org/projects/ruby/changeset/4572
Author:   watson1978 at gmail.com
Date:     2010-10-04 15:47:47 -0700 (Mon, 04 Oct 2010)
Log Message:
-----------
Fixed a bug that throws an exception of "undefined method `size' for nil:NilClass'" with Date.httpdate.
 - Fixed the #928

Modified Paths:
--------------
    MacRuby/trunk/lib/date/format.rb

Modified: MacRuby/trunk/lib/date/format.rb
===================================================================
--- MacRuby/trunk/lib/date/format.rb	2010-10-04 22:47:43 UTC (rev 4571)
+++ MacRuby/trunk/lib/date/format.rb	2010-10-04 22:47:47 UTC (rev 4572)
@@ -1182,7 +1182,7 @@
 	\d{2}:\d{2}(:\d{2})?\s*
 	(?:[-+]\d{4}|ut|gmt|e[sd]t|c[sd]t|m[sd]t|p[sd]t|[a-ik-z])\s*\z/iox =~ str
       e = _parse(str, false)
-      if $1.size < 4
+      if (($1.nil?) || ($1.size < 4))
 	if e[:year] < 50
 	  e[:year] += 2000
 	elsif e[:year] < 1000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101004/57323baf/attachment.html>


More information about the macruby-changes mailing list