[前][次][番号順一覧][スレッド一覧]

ruby-changes:30050

From: nobu <ko1@a...>
Date: Mon, 22 Jul 2013 09:48:47 +0900 (JST)
Subject: [ruby-changes:30050] nobu:r42102 (trunk): readline.c: $SAFE

nobu	2013-07-22 09:48:35 +0900 (Mon, 22 Jul 2013)

  New Revision: 42102

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42102

  Log:
    readline.c: $SAFE
    
    * ext/readline/readline.c (readline_s_delete_text): $SAFE=4 is
      obsolete.

  Modified files:
    trunk/ext/readline/readline.c

Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c	(revision 42101)
+++ ext/readline/readline.c	(revision 42102)
@@ -44,6 +44,10 @@ https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L44
 #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 https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L578
 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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]