public
Description: ruby lang (www.ruby-lang.org) svn mirror
Homepage: http://svn.ruby-lang.org/repos/ruby/
Clone URL: git://github.com/juretta/ruby.git
Search Repo:
* file.c (rb_find_file_ext, rb_find_file): converts Windows style path
  to Cygwin path.  [ruby-dev:35647]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18197 
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
nobu (author)
Thu Jul 24 08:10:31 -0700 2008
commit  ee86fc46f29673bd0f8a45a07cba84485f824404
tree    e7f02428beb3a9b79d969d93c273cd10c7008d9c
parent  0c5f365327f7d6f157612ffb32f2c5321cfe6872
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+Fri Jul 25 00:10:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
0
+
0
+ * file.c (rb_find_file_ext, rb_find_file): converts Windows style path
0
+ to Cygwin path. [ruby-dev:35647]
0
+
0
 Thu Jul 24 16:30:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
0
 
0
   * win32/win32.c (exit_handler): use st_free_table() to free socklist.
0
...
4447
4448
4449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4450
4451
4452
...
4493
4494
4495
 
4496
4497
4498
...
4551
4552
4553
 
4554
4555
4556
...
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
...
4512
4513
4514
4515
4516
4517
4518
...
4571
4572
4573
4574
4575
4576
4577
0
@@ -4447,6 +4447,25 @@ file_load_ok(const char *path)
0
     return eaccess(path, R_OK) == 0;
0
 }
0
 
0
+#ifdef __CYGWIN__
0
+static void
0
+intern_cygwin_path(volatile VALUE *path)
0
+{
0
+ char rubylib[MAXPATHLEN];
0
+ VALUE str = *path;
0
+ const char *p = RSTRING_PTR(str);
0
+
0
+ if (*p == '\\' || has_drive_letter(p)) {
0
+ if (cygwin_conv_to_posix_path(p, rubylib) == 0) {
0
+ *path = rb_str_new2(rubylib);
0
+ }
0
+ }
0
+}
0
+#define intern_path(str) intern_cygwin_path(&(str))
0
+#else
0
+#define intern_path(str) (void)(str)
0
+#endif
0
+
0
 VALUE rb_get_load_path(void);
0
 
0
 int
0
@@ -4493,6 +4512,7 @@ rb_find_file_ext(VALUE *filep, const char *const *ext)
0
 
0
    FilePathValue(str);
0
    if (RSTRING_LEN(str) == 0) continue;
0
+ intern_path(str);
0
    path = RSTRING_PTR(str);
0
    found = dln_find_file_r(StringValueCStr(fname), path, fbuf, sizeof(fbuf));
0
    if (found && file_load_ok(found)) {
0
@@ -4551,6 +4571,7 @@ rb_find_file(VALUE path)
0
    VALUE str = RARRAY_PTR(load_path)[i];
0
    FilePathValue(str);
0
    if (RSTRING_LEN(str) > 0) {
0
+ intern_path(str);
0
     rb_ary_push(tmp, str);
0
    }
0
   }

Comments

    No one has commented yet.