From 7cdc78e284f0e2d5004ba14b211eba28e297161c Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 21 May 2018 12:25:45 +0000 Subject: [PATCH] ruby.c: localize a variable * ruby.c (ruby_init_loadpath_safe): moved libdir to the block where it is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ruby.c b/ruby.c index 2a8141c52e..2cdf1a0f26 100644 --- a/ruby.c +++ b/ruby.c @@ -561,15 +561,6 @@ ruby_init_loadpath_safe(int safe_level) #else # define RUBY_ARCH_PATH "/"RUBY_PLATFORM #endif - static const char libdir[] = "/" -#ifdef LIBDIR_BASENAME - LIBDIR_BASENAME -#else - "lib" -#endif - RUBY_ARCH_PATH; - const ptrdiff_t libdir_len = (ptrdiff_t)sizeof(libdir) - - rb_strlen_lit(RUBY_ARCH_PATH) - 1; char *libpath; VALUE sopath; size_t baselen; @@ -580,6 +571,15 @@ ruby_init_loadpath_safe(int safe_level) p = strrchr(libpath, '/'); if (p) { + static const char libdir[] = "/" +#ifdef LIBDIR_BASENAME + LIBDIR_BASENAME +#else + "lib" +#endif + RUBY_ARCH_PATH; + const ptrdiff_t libdir_len = (ptrdiff_t)sizeof(libdir) + - rb_strlen_lit(RUBY_ARCH_PATH) - 1; static const char bindir[] = "/bin"; const ptrdiff_t bindir_len = (ptrdiff_t)sizeof(bindir) - 1;