diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ruby.c | 22 | ||||
-rw-r--r-- | version.h | 4 |
3 files changed, 19 insertions, 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. @@ -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 |