summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-11 07:37:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-11 07:37:13 +0000
commitf477963e6e4b942628300ee151f071b11aca64e9 (patch)
treec7fb010429afb5946e72c3c86bec315a74107188
parent9e71120ca85b97b5b2f9d101bae177751ea7179c (diff)
* ruby.c (ruby_init_loadpath): do not mangle relative path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ruby.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6124ff48d5..47c483443e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Sun Apr 11 11:28:53 2010 Nobuyoshi Nakada <[email protected]>
+Sun Apr 11 16:37:12 2010 Nobuyoshi Nakada <[email protected]>
+
+ * ruby.c (ruby_init_loadpath): do not mangle relative path.
* ruby.c (ruby_init_loadpath): fix for the length of mangled path.
[ruby-core:29398]
diff --git a/ruby.c b/ruby.c
index 575bb44295..b88c0f5955 100644
--- a/ruby.c
+++ b/ruby.c
@@ -251,7 +251,6 @@ ruby_init_loadpath()
char libpath[FILENAME_MAX+1];
size_t baselen;
char *p;
- int rest;
#if defined _WIN32 || defined __CYGWIN__
HMODULE libruby = NULL;
MEMORY_BASIC_INFORMATION m;
@@ -297,9 +296,9 @@ ruby_init_loadpath()
#define PREFIX_PATH() rb_str_new(libpath, baselen)
baselen = p - libpath;
- rest = FILENAME_MAX - baselen;
+#define BASEPATH() rb_str_buf_cat(rb_str_buf_new(baselen+len), libpath, baselen)
-#define RUBY_RELATIVE(path, len) (strncpy(p, (path), rest), rubylib_mangled_path(libpath, baselen+(len)))
+#define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), path, len)
#else
static const char exec_prefix[] = RUBY_EXEC_PREFIX;
#define RUBY_RELATIVE(path, len) rubylib_mangled_path(path, len)