[#25976] tnono dumps core — nobu@...

なかだです。

16 messages 2005/04/02
[#25977] Re: tnono dumps core — Masaki Suketa <masaki.suketa@...> 2005/04/03

助田です。

[#25998] ruby 1.8.3 preview予定 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

45 messages 2005/04/07
[#26011] bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/10

山本です。

[#26012] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/10

なかだです。

[#26013] Re: bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/11

山本です。

[#26014] Re: bcc32、win32 での install-doc の動作 — "U.Nakamura" <usa@...> 2005/04/11

こんにちは、なかむら(う)です。

[#26034] Re: bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/12

山本です。

[#26035] Re: bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/12

山本です。

[#26036] Re: bcc32、win32 での install-doc の動作 — "U.Nakamura" <usa@...> 2005/04/12

こんにちは、なかむら(う)です。

[#26040] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/13

なかだです。

[#26041] Re: bcc32、win32 での install-doc の動作 — "U.Nakamura" <usa@...> 2005/04/13

こんにちは、なかむら(う)です。

[#26042] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/13

なかだです。

[#26043] Re: bcc32、win32 での install-doc の動作 — "U.Nakamura" <usa@...> 2005/04/13

こんにちは、なかむら(う)です。

[#26045] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/13

なかだです。

[#26049] Re: bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/14

山本です。

[#26051] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/14

なかだです。

[#26059] Re: bcc32、win32 での install-doc の動作 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/04/14

山本です。

[#26060] Re: bcc32、win32 での install-doc の動作 — nobu@... 2005/04/15

なかだです。

[#26100] FileUtils.rm_rf security problem — Tanaka Akira <akr@...17n.org>

ふと、CVE で perl 関係のを見ていたら、File::Path の rmtree に関するも

21 messages 2005/04/26
[#26102] Re: FileUtils.rm_rf security problem — Tanaka Akira <akr@...17n.org> 2005/04/26

[#26190] Re: FileUtils.rm_rf security problem — Minero Aoki <aamine@...> 2005/05/20

青木です。

[#26191] Re: FileUtils.rm_rf security problem — Tanaka Akira <akr@...17n.org> 2005/05/20

In article <20050520171837N.aamine@loveruby.net>,

[#26192] Re: FileUtils.rm_rf security problem — Minero Aoki <aamine@...> 2005/05/20

青木です。

[#26197] Re: FileUtils.rm_rf security problem — Minero Aoki <aamine@...> 2005/05/21

青木です。

[ruby-dev:26090] expand include path by -I

From: nobu@...
Date: 2005-04-20 15:33:10 UTC
List: ruby-dev #26090
なかだです。

コマンドラインから-Iで相対パスが指定された場合、-CやDir.chdirを
使うと別のディレクトリを指すことになりますが、最初に指定された
ときのまま固定のほうが使いやすいのでないでしょうか。つまり、-I
の引数はその場で絶対パスに展開する、ということです。


Index: ruby.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ruby.c,v
retrieving revision 1.97
diff -U2 -p -r1.97 ruby.c
--- ruby.c	4 Mar 2005 06:47:41 -0000	1.97
+++ ruby.c	20 Apr 2005 03:53:07 -0000
@@ -179,6 +179,7 @@ rubylib_mangle(s, l)
 
 void
-ruby_incpush(path)
+ruby_push_include(path, filter)
     const char *path;
+    VALUE (*filter)_((VALUE));
 {
     const char sep = PATH_SEP_CHAR;
@@ -200,9 +201,9 @@ ruby_incpush(path)
 	    while (*p == sep) p++;
 	    if (s = strchr(p, sep)) {
-		rb_ary_push(ary, rubylib_mangled_path(p, (int)(s-p)));
+		rb_ary_push(ary, (*filter)(rubylib_mangled_path(p, (int)(s-p))));
 		p = s + 1;
 	    }
 	    else {
-		rb_ary_push(ary, rubylib_mangled_path2(p));
+		rb_ary_push(ary, (*filter)(rubylib_mangled_path2(p)));
 		break;
 	    }
@@ -211,8 +212,38 @@ ruby_incpush(path)
     }
     else {
-	rb_ary_push(rb_load_path, rubylib_mangled_path2(path));
+	rb_ary_push(rb_load_path, (*filter)(rubylib_mangled_path2(path)));
     }
 }
 
+static VALUE
+identical_path(path)
+     VALUE path;
+{
+    return path;
+}
+
+void 
+ruby_incpush(const char *path)
+{
+    ruby_push_include(path, identical_path);
+}
+
+static VALUE
+expand_include_path(path)
+    VALUE path;
+{
+    char *p = RSTRING(path)->ptr;
+    if (!p) return path;
+    if (*p == '.' && p[1] == '/') return path;
+    return rb_file_expand_path(path, Qnil);
+}
+
+
+void 
+ruby_incpush_expand(const char *path)
+{
+    ruby_push_include(path, expand_include_path);
+}
+
 #if defined DOSISH || defined __CYGWIN__
 #define LOAD_RELATIVE 1
@@ -627,7 +658,7 @@ proc_options(argc, argv)
 	    forbid_setid("-I");
 	    if (*++s)
-		ruby_incpush(s);
+		ruby_incpush_expand(s);
 	    else if (argv[1]) {
-		ruby_incpush(argv[1]);
+		ruby_incpush_expand(argv[1]);
 		argc--,argv++;
 	    }


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next