diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-15 08:44:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-10-15 08:44:38 +0000 |
commit | 80c343807dcca3099466c1e8ab7a302339174f55 (patch) | |
tree | b761c69f12cf70b8adc6725d0d31b4f2c8ff0a89 /ruby.c | |
parent | 5590d804cd18f2a12f7a09c05b070f048714cebc (diff) |
19991015
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -176,8 +176,11 @@ rubylib_mangle(s, l) strcpy(ret + newl, s + oldl); return ret; } +#define rubylib_mangled_path(s, l) rb_str_new2(rubylib_mangle((s), (l))) +#define rubylib_mangled_path2(s) rb_str_new2(rubylib_mangle((s), 0)) #else -#define rubylib_mangle(s, l) (s) +#define rubylib_mangled_path(s, l) rb_str_new((s), (l)) +#define rubylib_mangled_path2(s) rb_str_new2(s) #endif static void @@ -202,18 +205,18 @@ addpath(path) while (*p) { while (*p == sep) p++; if (s = strchr(p, sep)) { - rb_ary_push(ary, rb_str_new(rubylib_mangle(p, (int)(s-p)), (int)(s-p))); + rb_ary_push(ary, rubylib_mangled_path(p, (int)(s-p))); p = s + 1; } else { - rb_ary_push(ary, rb_str_new2(rubylib_mangle(p, 0))); + rb_ary_push(ary, rubylib_mangled_path2(p)); break; } } rb_load_path = rb_ary_plus(ary, rb_load_path); } else { - rb_ary_unshift(rb_load_path, rb_str_new2(rubylib_mangle(path, 0))); + rb_ary_unshift(rb_load_path, rubylib_mangled_path2(path)); } } |