summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-09 14:11:23 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-09 14:11:23 +0000
commitb4ea8ddcdd86cdfaf48e3217ef02a7530827232f (patch)
tree79dce744500a20647ab1648bf17ef2c8a8f69414
parent106a65482bf17a10a48344d1f9c2d11cd8b58cf8 (diff)
ruby.c (ruby_init_loadpath): convert '\' to '/'
before finding executable file path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ruby.c22
-rw-r--r--version.h4
3 files changed, 19 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 346b828..e4d43c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Feb 9 22:54:57 2001 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * ruby.c (ruby_init_loadpath): convert '\\' to '/'
+ before finding executable file path.
+
Thu Feb 8 21:27:24 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/mkmf.rb (install_rb): fix handling of relative path.
diff --git a/ruby.c b/ruby.c
index 2438bd9..5d92800 100644
--- a/ruby.c
+++ b/ruby.c
@@ -214,13 +214,23 @@ ruby_init_loadpath()
#elif defined(DJGPP)
extern char *__dos_argv0;
strncpy(libpath, __dos_argv0, FILENAME_MAX);
+#define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
#elif defined(__EMX__)
_execname(libpath, FILENAME_MAX);
#endif
- p = strrchr(libpath, '\\');
+
+#ifndef CharNext /* defined as CharNext[AW] on Windows. */
+#define CharNext(p) ((p) + 1)
+#endif
+
+ for (p = libpath; *p; p = CharNext(p))
+ if (*p == '\\')
+ *p = '/';
+
+ p = strrchr(libpath, '/');
if (p) {
*p = 0;
- if (p-libpath > 3 && !strcasecmp(p-4, "\\bin")) {
+ if (p-libpath > 3 && !strcasecmp(p-4, "/bin")) {
p -= 4;
*p = 0;
}
@@ -229,14 +239,6 @@ ruby_init_loadpath()
p = libpath + 1;
}
-#if !defined(__CYGWIN32__)
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-#define CharNext(p) ((p) + 1)
-#endif
- for (p = libpath; *p; p = CharNext(p))
- if (*p == '\\')
- *p = '/';
-#endif
rest = FILENAME_MAX - (p - libpath);
#define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath)
diff --git a/version.h b/version.h
index 14aa099..cd09b87 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.0"
-#define RUBY_RELEASE_DATE "2001-02-08"
+#define RUBY_RELEASE_DATE "2001-02-09"
#define RUBY_VERSION_CODE 170
-#define RUBY_RELEASE_CODE 20010208
+#define RUBY_RELEASE_CODE 20010209