summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/scalar_scanner.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-28 17:42:38 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-28 17:42:38 +0000
commit48602d1dbfe6e17f47704839f1721ee254150694 (patch)
treedf63f6eeeee04932591cace7a7d2d2a330dff4b3 /ext/psych/lib/psych/scalar_scanner.rb
parent806ddf671313be82a977d4afba9ff668d95bbb14 (diff)
* 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
Diffstat (limited to 'ext/psych/lib/psych/scalar_scanner.rb')
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
1 files changed, 1 insertions, 1 deletions
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