From b4ea8ddcdd86cdfaf48e3217ef02a7530827232f Mon Sep 17 00:00:00 2001 From: eban Date: Fri, 9 Feb 2001 14:11:23 +0000 Subject: 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 --- ChangeLog | 5 +++++ ruby.c | 22 ++++++++++++---------- version.h | 4 ++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 346b828ecb..e4d43c8b4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 9 22:54:57 2001 WATANABE Hirofumi + + * ruby.c (ruby_init_loadpath): convert '\\' to '/' + before finding executable file path. + Thu Feb 8 21:27:24 2001 WATANABE Hirofumi * lib/mkmf.rb (install_rb): fix handling of relative path. diff --git a/ruby.c b/ruby.c index 2438bd9b99..5d92800d3a 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 14aa099c84..cd09b879e2 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 -- cgit v1.2.3