summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:11:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:11:41 +0000
commitf35308b3ef20be1716660a751087b4e726db2171 (patch)
tree0a81f4109473d2c5746f12c65c9287ef06b5b1e0 /ruby.c
parent6d3ceb6ce38f91898dfc388fc96f5401ff3edc52 (diff)
* eval_intern.h (translit_char): moved from ruby.c.
* load.c (load_ext): transliterates file separators and back if needed. * symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/ruby.c b/ruby.c
index 950c3e1ce0..5fdcb67c6b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -166,22 +166,6 @@ usage(const char *name)
VALUE rb_get_load_path(void);
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
-#endif
-
-#if defined DOSISH || defined __CYGWIN__
-static inline void
-translate_char(char *p, int from, int to)
-{
- while (*p) {
- if ((unsigned char)*p == from)
- *p = to;
- p = CharNext(p);
- }
-}
-#endif
-
#if defined _WIN32 || defined __CYGWIN__ || defined __SYMBIAN32__
static VALUE
rubylib_mangled_path(const char *s, unsigned int l)
@@ -206,7 +190,7 @@ rubylib_mangled_path(const char *s, unsigned int l)
if (newl == 0 || oldl == 0) {
rb_fatal("malformed RUBYLIB_PREFIX");
}
- translate_char(newp, '\\', '/');
+ translit_char(newp, '\\', '/');
}
else {
notfound = 1;
@@ -370,7 +354,7 @@ ruby_init_loadpath_safe(int safe_level)
libpath[sizeof(libpath) - 1] = '\0';
#if defined DOSISH
- translate_char(libpath, '\\', '/');
+ translit_char(libpath, '\\', '/');
#elif defined __CYGWIN__
{
char rubylib[FILENAME_MAX];
@@ -1270,7 +1254,7 @@ process_options(VALUE arg)
opt->script_name = rb_str_new_cstr(opt->script);
opt->script = RSTRING_PTR(opt->script_name);
#if defined DOSISH || defined __CYGWIN__
- translate_char(RSTRING_PTR(opt->script_name), '\\', '/');
+ translit_char(RSTRING_PTR(opt->script_name), '\\', '/');
#endif
rb_obj_freeze(opt->script_name);