From 38eb518feb76efd629a5d28899d5d837c5dc9236 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 22 Jul 2013 00:48:35 +0000 Subject: [PATCH] readline.c: $SAFE * ext/readline/readline.c (readline_s_delete_text): $SAFE=4 is obsolete. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/readline/readline.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 368be99b5b..a4d06b28b4 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -44,6 +44,10 @@ #include #endif +#ifndef RUBY_SAFE_LEVEL_MAX +#define RUBY_SAFE_LEVEL_MAX 4 /* 2.0 or earlier */ +#endif + static VALUE mReadline; #define EDIT_LINE_LIBRARY_VERSION "EditLine wrapper" @@ -574,7 +578,7 @@ readline_s_insert_text(VALUE self, VALUE str) static VALUE readline_s_delete_text(int argc, VALUE *argv, VALUE self) { - rb_secure(4); + rb_secure(RUBY_SAFE_LEVEL_MAX); rb_check_arity(argc, 0, 2); if (rl_line_buffer) { char *p, *ptr = rl_line_buffer;