summaryrefslogtreecommitdiff
path: root/ext/syck/lib/syck
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-30 19:45:30 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-30 19:45:30 +0000
commitd074ef4d60e389348d10dd1d81e76634c17acb2d (patch)
treef11e712b6564846cfda612cba73797920a59e224 /ext/syck/lib/syck
parent16ceba03968244e64e015965c2f3ec6a8f1836fb (diff)
* string.c (tr_setup_table): fix bug in r29146.
Initialize table even if cflag is 0; tr_find see whether del is empty or not. * string.c (tr_find): nodel can't be NULL; if NULL, it means it is not specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/lib/syck')
-rw-r--r--ext/syck/lib/syck/rubytypes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/syck/lib/syck/rubytypes.rb b/ext/syck/lib/syck/rubytypes.rb
index 50a6f4622b..f8bbfea022 100644
--- a/ext/syck/lib/syck/rubytypes.rb
+++ b/ext/syck/lib/syck/rubytypes.rb
@@ -148,7 +148,7 @@ class String
to_yaml_style or not to_yaml_properties.empty? or self =~ /\n.+/
end
def is_binary_data?
- self.count("^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
+ self.count("\x00-\x7F", "^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
end
def String.yaml_new( klass, tag, val )
val = val.unpack("m")[0] if tag == "tag:yaml.org,2002:binary"