From 62261ccb47fce9c4728cfbeb84f81d23369ab910 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 28 Mar 2001 08:43:25 +0000 Subject: * object.c (rb_str2cstr): warn if string contains \0 and length value is ignored. * class.c (rb_singleton_class_clone): should copy class constant table as well. * class.c (rb_include_module): sometimes cache was mistakenly left uncleared - based on the patch by K.Kosako. * ruby.h: all Check_SafeStr()'s are replaced by SafeStr() to ensure 'to_str' be always effective. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index 03c9b61f3d..839bbb5e52 100644 --- a/ruby.h +++ b/ruby.h @@ -177,7 +177,14 @@ VALUE rb_uint2inum _((unsigned long)); void rb_check_type _((VALUE,int)); #define Check_Type(v,t) rb_check_type((VALUE)(v),t) void rb_check_safe_str _((VALUE)); +/* obsolete macro - use SafeStr(v) */ #define Check_SafeStr(v) rb_check_safe_str((VALUE)(v)) +VALUE rb_str_to_str _((VALUE)); +#define SafeStr(v) do {\ + v = rb_str_to_str(v);\ + rb_check_safe_str(v);\ +} while (0) + void rb_secure _((int)); EXTERN int ruby_safe_level; -- cgit v1.2.3