mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e1c96af53
commit
9780fc27d9
3 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
Thu May 22 06:21:33 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
||||
|
||||
* 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.
|
||||
|
||||
Thu May 22 05:43:24 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
||||
|
||||
* ext/syck/rubyext.c (syck_parser_load): root-level false was returning
|
||||
|
|
|
@ -379,7 +379,7 @@ rb_syck_err_handler(p, msg)
|
|||
endl++;
|
||||
|
||||
endl[0] = '\0';
|
||||
rb_raise(rb_eLoadError, "%s on line %d, col %d: `%s'",
|
||||
rb_raise(rb_eArgError, "%s on line %d, col %d: `%s'",
|
||||
msg,
|
||||
p->linect,
|
||||
p->cursor - p->lineptr,
|
||||
|
|
|
@ -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 )}\""
|
||||
|
|
Loading…
Reference in a new issue