summaryrefslogtreecommitdiff
path: root/ext/psych
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-29 21:24:33 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-29 21:24:33 +0000
commit8662841a9b48bfaa3506eb93c47ceabe88e7f488 (patch)
treeb85ace7a8daea6a3fa65d62edc2e8f68aed6f13b /ext/psych
parent73645bb8e55dad0526419c7e434746d042fdacc1 (diff)
* ext/psych/lib/psych/scalar_scanner.rb: fix loading strings that
look like integers but have a newline. Fixes GH #189 * test/psych/test_string.rb: test for fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych')
-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 3fc9edd25d..93007902a7 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -37,7 +37,7 @@ module Psych
case string
# Check for a String type, being careful not to get caught by hash keys, hex values, and
# special floats (e.g., -.inf).
- when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/
+ when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/, /\n/
if string.length > 5
@string_cache[string] = true
return string