diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-21 12:25:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-21 12:25:45 +0000 |
commit | 7cdc78e284f0e2d5004ba14b211eba28e297161c (patch) | |
tree | e2eaeeb53de32e7a3c215b1c0c407a477e64add7 | |
parent | 68b87aedde5e2692c564ef5342215df12a7291b0 (diff) | |
download | ruby-7cdc78e284f0e2d5004ba14b211eba28e297161c.tar.gz |
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
-rw-r--r-- | ruby.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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; |