From 50784a0a4412df551d96dd01067473cd4226481b Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 Jan 2019 09:08:31 +0000 Subject: Defer escaping control char in error messages * eval_error.c (print_errinfo): defer escaping control char in error messages until writing to stderr, instead of quoting at building the message. [ruby-core:90853] [Bug #15497] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 83707f8749..28afa4cfc0 100644 --- a/ruby.c +++ b/ruby.c @@ -1367,16 +1367,9 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt) default: { - if (ISPRINT(*s)) { - rb_raise(rb_eRuntimeError, + rb_raise(rb_eRuntimeError, "invalid option -%c (-h will show valid options)", (int)(unsigned char)*s); - } - else { - rb_raise(rb_eRuntimeError, - "invalid option -\\x%02X (-h will show valid options)", - (int)(unsigned char)*s); - } } goto switch_end; -- cgit v1.2.3