summaryrefslogtreecommitdiffstats
path: root/lib/yaml
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-22 06:14:17 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-22 06:14:17 +0000
commit97382004344131d65a73380305cda5ced315c810 (patch)
tree61a47dc64a0d9f0b8af06a0ec2ec27084360790a /lib/yaml
parent6bd8855d30edadd3be0148f3e4a05a8542944832 (diff)
downloadruby-97382004344131d65a73380305cda5ced315c810.tar.gz
ruby-97382004344131d65a73380305cda5ced315c810.tar.xz
ruby-97382004344131d65a73380305cda5ced315c810.zip
* ext/syck/rubyext.c (rb_syck_err_handler): raise ArgumentError on
malformed YAML. * lib/yaml/rubytypes.rb: String#to_yaml was missing space indicators at the end of a line. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/rubytypes.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index ae5585db5..a67023763 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -1,4 +1,5 @@
require 'date'
+require 'yaml/constants'
#
# Type conversions
#
@@ -273,7 +274,7 @@ class String
"''"
elsif YAML.detect_implicit( self ) != 'str'
"\"#{YAML.escape( self )}\""
- elsif self =~ /#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}] |\n|\'/
+ elsif self =~ /#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |\n|$)|\'/
"\"#{YAML.escape( self )}\""
elsif self =~ /^[^#{YAML::WORD_CHAR}]/
"\"#{YAML.escape( self )}\""