From 7425d4f6ef047dd274cbea8115955462d5449330 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Fri, 27 Feb 1998 07:48:11 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'r1_1b9'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/r1_1b9@100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dln.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'dln.c') diff --git a/dln.c b/dln.c index f4ab012021..5d4ed14800 100644 --- a/dln.c +++ b/dln.c @@ -6,20 +6,20 @@ $Date$ created at: Tue Jan 18 17:05:06 JST 1994 - Copyright (C) 1993-1996 Yukihiro Matsumoto + Copyright (C) 1993-1998 Yukihiro Matsumoto ************************************************/ -#ifdef _AIX -#pragma alloca -#endif - #include "config.h" #include "defines.h" #include "dln.h" char *dln_argv0; +#ifdef _AIX +#pragma alloca +#endif + #if defined(HAVE_ALLOCA_H) && !defined(__GNUC__) #include #endif @@ -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; -- cgit v1.2.3