[#22503] can't require — IWATSUKI Hiroyuki <don@...>

岩月と申します。

94 messages 2004/01/06
[#22504] Re: can't require — nobu.nakada@... 2004/01/06

なかだです。

[#22505] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/06

まつもと ゆきひろです

[#22506] Re: can't require — IWATSUKI Hiroyuki <don@...> 2004/01/06

岩月と申します。

[#22509] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22513] Re: can't require — IWATSUKI Hiroyuki <don@...> 2004/01/07

岩月と申します。

[#22514] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22522] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22524] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22526] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22534] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22535] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/07

まつもと ゆきひろです

[#22536] Re: can't require — Tanaka Akira <akr@...17n.org> 2004/01/07

In article <1073474004.933446.5475.nullmailer@picachu.netlab.jp>,

[#22540] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22541] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。なかださんのコードで気になった点が3つあります。

[#22546] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22549] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/08

山本です。

[#22550] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/08

山本です。

[#22551] Re: can't require — nobu.nakada@... 2004/01/08

なかだです。

[#22571] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/11

山本です。

[#22667] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/22

山本です。

[#22668] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/22

まつもと ゆきひろです

[#22669] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/22

山本です。

[#22676] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/24

山本です。

[#22677] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22678] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22679] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22680] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22682] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22683] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22686] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/26

山本です。

[#22687] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/26

山本です。

[#22697] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22700] Re: can't require — nobu.nakada@... 2004/01/27

なかだです。

[#22712] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。WinCVS + byacc + sed をインストールして、ビルドできるようになりました。

[#22714] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22716] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22725] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22729] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22734] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22736] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22738] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22739] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22740] Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/28

なかだです。

[#22741] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22744] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22746] Re: Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/28

なかだです。

[#22747] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22748] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22750] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22761] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22764] Re: Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/29

なかだです。

[#22766] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22770] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22772] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22774] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/29

まつもと ゆきひろです

[#22688] output directory for extensions — nobu.nakada@...

なかだです。

14 messages 2004/01/26

[#22691] 次期リリースでの新規添付ライブラリ — "Kawaji, Shinya" <kawaji@...>

かわじ、です

18 messages 2004/01/26
[#22693] Re: 次期リリースでの新規添付ライブラリ — matz@... (Yukihiro Matsumoto) 2004/01/26

まつもと ゆきひろです

[#22694] Re: 次期リリースでの新規添付ライブラリ — matz@... (Yukihiro Matsumoto) 2004/01/26

まつもと ゆきひろです

[#22763] $: trick in test/* — "NAKAMURA, Hiroshi" <nakahiro@...>

なひです。

21 messages 2004/01/29

[ruby-dev:22540] Re: can't require

From: nobu.nakada@...
Date: 2004-01-07 12:27:13 UTC
List: ruby-dev #22540
なかだです。

At Wed, 7 Jan 2004 20:28:35 +0900,
Tanaka Akira wrote:
> > |+#define GLOB_DEPTH	0x0100
> >
> > という名前はあんまり良くないのでGLOB_DEPTHFIRSTとかにしても
> > らった方が良さそう。
> 
> えーと、豆知識ですが、find(1) の -depth というオプションは find の挙動
> を深さ優先に変えるものではなく、帰りがけ順に変えるもので、不適切な名前
> です。

なんとなく記憶に引っかかってたんですが、思い出せませんでした。

> なので、DEPTH や DEPTHFIRST じゃなくて POSTORDER のほうがいいんじゃな
> いでしょうか。

ということで[ruby-dev:22534]からの差分です。

あとlinkのループのところでメモリリークしてます。


--- dir.c~	2004-01-07 19:31:14.000000000 +0900
+++ dir.c	2004-01-07 21:08:33.000000000 +0900
@@ -71,7 +71,7 @@
 #define FNM_PATHNAME	0x02
 #define FNM_DOTMATCH	0x04
 #define FNM_CASEFOLD	0x08
-#define GLOB_DEPTH	0x0100
+#define GLOB_POSTORDER	0x0100
 
 #define FNM_NOMATCH	1
 #define FNM_ERROR	2
@@ -1001,8 +1002,8 @@
     struct dirent *dp;
     int recursive = 0;
     int magical = 1;
-    int maxlen = 0, buflen;
-    int n1;
+    int maxlen = 0;
+    int n1, mlen;
 #define ALLOC_BUF(size) do {					\
 	int buflen = size;					\
 	if (!maxlen) {						\
@@ -1076,7 +1076,8 @@
 
     n1 = p - path;
 
-    if (!magical && !(flags & GLOB_DEPTH)) {
+    mlen = strlen(m);
+    if (!magical && !(flags & GLOB_POSTORDER)) {
 	status = glob_helper(path, p, separator, flags, func, arg);
     }
     for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
@@ -1097,7 +1098,7 @@
 #else
 	    if (dp->d_isdir) dirtype = (dp->d_isrep ? symlnk : dir);
 #endif
-	    if (dirtype == dir && (flags & GLOB_DEPTH)) {
+	    if (dirtype == dir && (flags & GLOB_POSTORDER)) {
 		strcpy(buf+n2, "/**/");
 		strcpy(buf+n2+4, p);
 		status = glob_helper(buf, buf+n2+1, 1, flags, func, arg);
@@ -1129,6 +1130,6 @@
 	    }
 	}
-	if (dirtype == dir && !(flags & GLOB_DEPTH)) {
+	if (dirtype == dir && !(flags & GLOB_POSTORDER)) {
 	    strcpy(buf+n2, "/**/");
 	    strcpy(buf+n2+4, p);
 	    status = glob_helper(buf, buf+n2+1, 1, flags, func, arg);
@@ -1140,8 +1141,7 @@
     while (link) {
 	if (status == 0) {
 	    const int n2 = n1 + strlen(link->name);
-	    buf = ALLOC_N(char, n2+strlen(m)+1);
-	    memcpy(buf, path, n1);
+	    ALLOC_BUF(n2+mlen+1);
 	    strcpy(buf+n1, link->name);
 	    strcpy(buf+n2, m);
 	    status = glob_helper(buf, buf+n2+1, 1, flags, func, arg);
@@ -1152,7 +1152,7 @@
 	free(tmp);
     }
 
-    if (!magical && (flags & GLOB_DEPTH)) {
+    if (!magical && (flags & GLOB_POSTORDER)) {
 	status = glob_helper(path, p, separator, flags, func, arg);
     }
 
@@ -1546,5 +1546,5 @@
     rb_file_const("FNM_DOTMATCH", INT2FIX(FNM_DOTMATCH));
     rb_file_const("FNM_CASEFOLD", INT2FIX(FNM_CASEFOLD));
 
-    rb_define_const(rb_cDir, "GLOB_DEPTH", INT2FIX(GLOB_DEPTH));
+    rb_define_const(rb_cDir, "GLOB_POSTORDER", INT2FIX(GLOB_POSTORDER));
 }


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

In This Thread