summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
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 4a8dcdc..5d4ed14 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;