mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
106a65482b
commit
b4ea8ddcdd
3 changed files with 19 additions and 12 deletions
|
@ -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.
|
||||
|
|
22
ruby.c
22
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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue