summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 14:24:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 14:24:41 +0000
commit39b5931d74e7eb1134ccd0e2e23d7fc50c35f3b5 (patch)
tree989fec3b021c49917ee0b02eb0b77bd315a726f5 /ext/readline
parent0780974482103f4b681f699b54068b9fe9eb5043 (diff)
readline.c: $SAFE 4
* ext/readline/readline.c (readline_s_delete_text): call rb_secure only if level 4 is allowed. otherwise do nothing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index a4d06b2..714b08c 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -578,7 +578,9 @@ readline_s_insert_text(VALUE self, VALUE str)
static VALUE
readline_s_delete_text(int argc, VALUE *argv, VALUE self)
{
- rb_secure(RUBY_SAFE_LEVEL_MAX);
+#if RUBY_SAFE_LEVEL_MAX >= 4
+ rb_secure(4);
+#endif
rb_check_arity(argc, 0, 2);
if (rl_line_buffer) {
char *p, *ptr = rl_line_buffer;