From 48602d1dbfe6e17f47704839f1721ee254150694 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 28 Aug 2013 17:42:38 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: invalid floats should be treated as strings. [Fixes GH-156] https://github.com/tenderlove/psych/issues/156 * test/psych/test_string.rb: test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/scalar_scanner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/psych') diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index 7a9bb87cbd..068fc0e3cf 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -95,7 +95,7 @@ module Psych end i when FLOAT - if string == '.' + if string =~ /\A[-+]?\.\Z/ @string_cache[string] = true string else -- cgit v1.2.3