summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-18 10:01:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-18 10:01:47 +0000
commit9c1657f302d0d0e5b8eefa2a70f73bdb57d5fcd6 (patch)
treeebac1b974c7c9a60b995c57b95e25e4a0ab3ca21 /dln.c
parenta9662810df18371af7492dd8298cc0cccc13c7c7 (diff)
cygwin patches
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@83 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/dln.c b/dln.c
index 4a8dcdc8ec..5d4ed14800 100644
--- a/dln.c
+++ b/dln.c
@@ -1367,6 +1367,30 @@ dln_find_file(fname, path)
return dln_find_1(fname, path, 0);
}
+#if defined(__CYGWIN32__)
+char *
+conv_to_posix_path(win32, posix)
+ char *win32;
+ char *posix;
+{
+ char *first = win32;
+ char *p = win32;
+ char *dst = posix;
+
+ for (p = win32; *p; p++)
+ if (*p == ';') {
+ *p = 0;
+ cygwin32_conv_to_posix_path(first, posix);
+ posix += strlen(posix);
+ *posix++ = ':';
+ first = p + 1;
+ *p = ';';
+ }
+ cygwin32_conv_to_posix_path(first, posix);
+ return dst;
+}
+#endif
+
static char fbuf[MAXPATHLEN];
static char *
@@ -1380,6 +1404,11 @@ dln_find_1(fname, path, exe_flag)
register char *bp;
struct stat st;
+#if defined(__CYGWIN32__)
+ char rubypath[MAXPATHLEN];
+ conv_to_posix_path(path, rubypath);
+ path = rubypath;
+#endif
if (fname[0] == '/') return fname;
if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0)
return fname;