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

ruby-changes:51056

From: nobu <ko1@a...>
Date: Thu, 26 Apr 2018 21:36:32 +0900 (JST)
Subject: [ruby-changes:51056] nobu:r63263 (trunk): ruby.c (ruby_init_loadpath_safe): constify

nobu	2018-04-26 21:36:26 +0900 (Thu, 26 Apr 2018)

  New Revision: 63263

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63263

  Log:
    ruby.c (ruby_init_loadpath_safe): constify

  Modified files:
    trunk/ruby.c
Index: ruby.c
===================================================================
--- ruby.c	(revision 63262)
+++ ruby.c	(revision 63263)
@@ -507,7 +507,7 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L507
     char *libpath;
     VALUE sopath;
     size_t baselen;
-    char *p;
+    const char *p;
 
 #if defined _WIN32 || defined __CYGWIN__
     {
@@ -549,11 +549,11 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L549
 	size_t newsize = cygwin_conv_path(win_to_posix, libpath, 0, 0);
 	if (newsize > 0) {
 	    VALUE rubylib = rb_str_new(0, newsize);
-	    p = RSTRING_PTR(rubylib);
-	    if (cygwin_conv_path(win_to_posix, libpath, p, newsize) == 0) {
+	    char *p2 = RSTRING_PTR(rubylib);
+	    if (cygwin_conv_path(win_to_posix, libpath, p2, newsize) == 0) {
 		rb_str_resize(sopath, 0);
 		sopath = rubylib;
-		libpath = p;
+		libpath = p2;
 	    }
 	}
     }
@@ -570,7 +570,7 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L570
 	const ptrdiff_t libdir_len = (ptrdiff_t)sizeof(libdir) - 1;
 
 #ifdef ENABLE_MULTIARCH
-	char *p2 = NULL;
+	const char *p2 = NULL;
 
       multiarch:
 #endif

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

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