summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--file.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9700fefcf7..8361a6250c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 25 00:10:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_find_file_ext, rb_find_file): converts Windows style path
+ to Cygwin path. [ruby-dev:35647]
+
Thu Jul 24 16:30:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (exit_handler): use st_free_table() to free socklist.
diff --git a/file.c b/file.c
index 419979bcfd..e8f7b9d84e 100644
--- a/file.c
+++ b/file.c
@@ -4447,6 +4447,25 @@ file_load_ok(const char *path)
return eaccess(path, R_OK) == 0;
}
+#ifdef __CYGWIN__
+static void
+intern_cygwin_path(volatile VALUE *path)
+{
+ char rubylib[MAXPATHLEN];
+ VALUE str = *path;
+ const char *p = RSTRING_PTR(str);
+
+ if (*p == '\\' || has_drive_letter(p)) {
+ if (cygwin_conv_to_posix_path(p, rubylib) == 0) {
+ *path = rb_str_new2(rubylib);
+ }
+ }
+}
+#define intern_path(str) intern_cygwin_path(&(str))
+#else
+#define intern_path(str) (void)(str)
+#endif
+
VALUE rb_get_load_path(void);
int
@@ -4493,6 +4512,7 @@ rb_find_file_ext(VALUE *filep, const char *const *ext)
FilePathValue(str);
if (RSTRING_LEN(str) == 0) continue;
+ intern_path(str);
path = RSTRING_PTR(str);
found = dln_find_file_r(StringValueCStr(fname), path, fbuf, sizeof(fbuf));
if (found && file_load_ok(found)) {
@@ -4551,6 +4571,7 @@ rb_find_file(VALUE path)
VALUE str = RARRAY_PTR(load_path)[i];
FilePathValue(str);
if (RSTRING_LEN(str) > 0) {
+ intern_path(str);
rb_ary_push(tmp, str);
}
}