From 2695d032e3fe0a342e586a03bd7f0eaffe52c5c1 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Fri, 25 Feb 2011 22:12:46 +0000 Subject: =?UTF-8?q?*=20ext/psych/lib/psych/scalar=5Fscanner.rb:=20fix=20pa?= =?UTF-8?q?rsing=20timezone's=20whose=20=20=20whose=20format=20is=20(+/-)h?= =?UTF-8?q?hmm.=20=20Thanks=20Gon=C3=A7alo=20Silva!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test/psych/test_scalar_scanner.rb: test for bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/scalar_scanner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/psych/lib/psych/scalar_scanner.rb') diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index e1e59d37e3..f7aaea7435 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -90,7 +90,7 @@ module Psych return time if 'Z' == md[3] return Time.at(time.to_i, us) unless md[3] - tz = md[3].split(':').map { |digit| Integer(digit, 10) } + tz = md[3].match(/^([+\-]?\d{1,2})\:?(\d{1,2})?$/)[1..-1].compact.map { |digit| Integer(digit, 10) } offset = tz.first * 3600 if offset < 0 -- cgit v1.2.3