From e115627a1846d2c15d1319e6399fa5f8d6e5cb61 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Mon, 7 Nov 2011 11:33:39 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look like base 60 numbers are serialized as quoted strings. * test/psych/test_string.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33655 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 e390cbb16a..a265a2baf3 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -61,7 +61,7 @@ module Psych else string.sub(/^:/, '').to_sym end - when /^[-+]?[1-9][0-9_]*(:[0-5]?[0-9])+$/ + when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/ i = 0 string.split(':').each_with_index do |n,e| i += (n.to_i * 60 ** (e - 2).abs) -- cgit v1.2.3