aboutsummaryrefslogtreecommitdiffstats
path: root/dln.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-24 02:52:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-24 02:52:08 +0000
commit37e11f3cce5dc533379117d216c09120b6546c26 (patch)
treed7bd385b2c33db30d80e573f9a370a2f4521e812 /dln.c
parent9afa9ba9673370d98d433ba24c06282ca8f1e5e8 (diff)
downloadruby-37e11f3cce5dc533379117d216c09120b6546c26.tar.gz
* dln.c (translit_separator): moved back from load.c again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c13
1 files changed, 13 insertions, 0 deletions
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