summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 00:48:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 00:48:35 +0000
commit38eb518feb76efd629a5d28899d5d837c5dc9236 (patch)
treede248a3971200ec19eac8fa7bc795295e26d580b /ext/readline
parent56af74277c5a3fd9dc5f07524248f78a292b280e (diff)
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
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 368be99..a4d06b2 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -44,6 +44,10 @@
#include <sys/stat.h>
#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;