diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-22 15:04:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-22 15:04:57 +0000 |
commit | 6f02547d83ec4651999b55f606672084cb0fe22b (patch) | |
tree | 33670755b21e35cdb937e083360465712d75b76a /eval_error.c | |
parent | 1df33a4a5f4bb1b2393cf5597e7d1156983c7741 (diff) |
internal.h: quote unprintable
* internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and
IDs. [Bug #7574] [ruby-dev:46749]
* string.c (rb_str_quote_unprintable): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.c')
-rw-r--r-- | eval_error.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/eval_error.c b/eval_error.c index 76140fcded..c7ccf82a0a 100644 --- a/eval_error.c +++ b/eval_error.c @@ -213,19 +213,19 @@ rb_print_undef(VALUE klass, ID id, int scope) case NOEX_PRIVATE: v = " private"; break; case NOEX_PROTECTED: v = " protected"; break; } - rb_name_error(id, "undefined%s method `%s' for %s `%s'", v, - rb_id2name(id), + rb_name_error(id, "undefined%s method `%"PRIsVALUE"' for %s `%"PRIsVALUE"'", v, + QUOTE_ID(id), (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class", - rb_class2name(klass)); + rb_class_name(klass)); } void rb_print_undef_str(VALUE klass, VALUE name) { - rb_name_error_str(name, "undefined method `%s' for %s `%s'", - RSTRING_PTR(name), + rb_name_error_str(name, "undefined method `%"PRIsVALUE"' for %s `%"PRIsVALUE"'", + QUOTE(name), (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class", - rb_class2name(klass)); + rb_class_name(klass)); } static int |