git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2000-07-24 09:58:10 +00:00
parent a4fe713cb1
commit b9373b7aea
4 changed files with 21 additions and 16 deletions

View File

@ -1,6 +1,12 @@
Mon Jul 24 18:52:55 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* win32/win32.c (win32_getenv): should remove `static'.
* ruby.c (rubylib_mangle): support "/hoge;/foo"
Sun Jul 23 12:55:04 2000 Dave Thomas <Dave@Thomases.com> Sun Jul 23 12:55:04 2000 Dave Thomas <Dave@Thomases.com>
* string.c (rb_str_rindex): Support negative end position. * string.c (rb_str_rindex): Support negative end position.
Fri Jul 21 17:35:01 2000 Yukihiro Matsumoto <matz@netlab.co.jp> Fri Jul 21 17:35:01 2000 Yukihiro Matsumoto <matz@netlab.co.jp>

10
ruby.c
View File

@ -146,19 +146,19 @@ rubylib_mangle(s, l)
notfound = 1; notfound = 1;
} }
} }
if (!newp) {
return s;
}
if (l == 0) { if (l == 0) {
l = strlen(s); l = strlen(s);
} }
if (l < oldl || strncasecmp(oldp, s, oldl) != 0) { if (!newp || l < oldl || strncasecmp(oldp, s, oldl) != 0) {
return s; strncpy(ret, s, l);
ret[l] = 0;
return ret;
} }
if (l + newl - oldl > STATIC_FILE_LENGTH || newl > STATIC_FILE_LENGTH) { if (l + newl - oldl > STATIC_FILE_LENGTH || newl > STATIC_FILE_LENGTH) {
rb_fatal("malformed RUBYLIB_PREFIX"); rb_fatal("malformed RUBYLIB_PREFIX");
} }
strcpy(ret + newl, s + oldl); strcpy(ret + newl, s + oldl);
ret[l + newl - oldl] = 0;
return ret; return ret;
} }
#define rubylib_mangled_path(s, l) rb_str_new2(rubylib_mangle((s), (l))) #define rubylib_mangled_path(s, l) rb_str_new2(rubylib_mangle((s), (l)))

View File

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4" #define RUBY_VERSION "1.5.4"
#define RUBY_RELEASE_DATE "2000-07-21" #define RUBY_RELEASE_DATE "2000-07-24"
#define RUBY_VERSION_CODE 154 #define RUBY_VERSION_CODE 154
#define RUBY_RELEASE_CODE 20000721 #define RUBY_RELEASE_CODE 20000724

View File

@ -2411,13 +2411,12 @@ wait()
char * char *
win32_getenv(const char *name) win32_getenv(const char *name)
{ {
static char *curitem = NULL; /* XXX threadead */ char *curitem = NULL; /* XXX threadead */
static DWORD curlen = 0; /* XXX threadead */ DWORD curlen = 0; /* XXX threadead */
DWORD needlen; DWORD needlen;
if (!curitem) {
curlen = 512; curlen = 512;
curitem = ALLOC_N(char, curlen); curitem = ALLOC_N(char, curlen);
}
needlen = GetEnvironmentVariable(name,curitem,curlen); needlen = GetEnvironmentVariable(name,curitem,curlen);
if (needlen != 0) { if (needlen != 0) {