mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
68b87aedde
commit
7cdc78e284
1 changed files with 9 additions and 9 deletions
18
ruby.c
18
ruby.c
|
@ -561,15 +561,6 @@ ruby_init_loadpath_safe(int safe_level)
|
||||||
#else
|
#else
|
||||||
# define RUBY_ARCH_PATH "/"RUBY_PLATFORM
|
# define RUBY_ARCH_PATH "/"RUBY_PLATFORM
|
||||||
#endif
|
#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;
|
char *libpath;
|
||||||
VALUE sopath;
|
VALUE sopath;
|
||||||
size_t baselen;
|
size_t baselen;
|
||||||
|
@ -580,6 +571,15 @@ ruby_init_loadpath_safe(int safe_level)
|
||||||
|
|
||||||
p = strrchr(libpath, '/');
|
p = strrchr(libpath, '/');
|
||||||
if (p) {
|
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";
|
static const char bindir[] = "/bin";
|
||||||
const ptrdiff_t bindir_len = (ptrdiff_t)sizeof(bindir) - 1;
|
const ptrdiff_t bindir_len = (ptrdiff_t)sizeof(bindir) - 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue