aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--dln.c13
-rw-r--r--load.c11
-rw-r--r--symbian/setup2
4 files changed, 18 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e193eb75a..1a3d4c7989 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Wed Feb 24 09:54:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 24 11:52:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dln.c (translit_separator): moved back from load.c again.
* dln_find.c: split from dln.c.
diff --git a/dln.c b/dln.c
index 129c1d0bfd..b91baa61f1 100644
--- a/dln.c
+++ b/dln.c
@@ -1218,6 +1218,18 @@ aix_loaderror(const char *pathname)
}
#endif
+#if defined(DLN_NEEDS_ALT_SEPARATOR) && DLN_NEEDS_ALT_SEPARATOR
+#define translit_separator(src) do { \
+ char *tmp = ALLOCA_N(char, strlen(src) + 1), *p = tmp, c; \
+ do { \
+ *p++ = ((c = *file++) == '/') ? DLN_NEEDS_ALT_SEPARATOR : c; \
+ } while (c); \
+ str = tmp; \
+ } while (0)
+#else
+#define translit_separator(str) (void)(str)
+#endif
+
void*
dln_load(const char *file)
{
@@ -1264,6 +1276,7 @@ dln_load(const char *file)
char *buf;
/* Load the file as an object one */
init_funcname(&buf, file);
+ translit_separator(file);
#ifdef USE_DLN_DLOPEN
#define DLN_DEFINED
diff --git a/load.c b/load.c
index 90d22d80ba..7551b6b629 100644
--- a/load.c
+++ b/load.c
@@ -536,17 +536,8 @@ load_failed(VALUE fname)
static VALUE
load_ext(VALUE path)
{
- VALUE result;
-
SCOPE_SET(NOEX_PUBLIC);
-#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR
- translit_char(RSTRING_PTR(path), '/', '\\');
-#endif
- result = (VALUE)dln_load(RSTRING_PTR(path));
-#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR
- translit_char(RSTRING_PTR(path), '\\', '/');
-#endif
- return result;
+ return (VALUE)dln_load(RSTRING_PTR(path));
}
VALUE
diff --git a/symbian/setup b/symbian/setup
index c9e153cb62..04d30858af 100644
--- a/symbian/setup
+++ b/symbian/setup
@@ -171,7 +171,7 @@ define config_h
@echo>>$(1) #define DLEXT_MAXLEN 4
@echo>>$(1) #define DLEXT ".dll"
@echo>>$(1) #define EXECUTABLE_EXTS ".exe",".com",".cmd",".bat"
-@echo>>$(1) #define DLN_NEEDS_ALT_SEPARATOR 1
+@echo>>$(1) #define DLN_NEEDS_ALT_SEPARATOR '\\'
@echo>>$(1) #define RUBY_LIB_VERSION_STYLE 3
@echo>>$(1) #define RUBY_LIB_PREFIX "C:/Data/Ruby/lib"
@echo>>$(1) #define RUBY_SITE_LIB "E:/Data/Ruby/lib"