[#13765] GenerativeHash — TAKAHASHI Masayoshi <maki@...>

高橋征義です。

17 messages 2001/07/08
[#13769] Re: GenerativeHash — matz@... (Yukihiro Matsumoto) 2001/07/09

まつもと ゆきひろです

[#13774] mkmf.rb: cleaning facility — Takaaki Tateishi <ttate@...>

立石です.

14 messages 2001/07/09

[#13800] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — nobu.nakada@...

なかだです。

20 messages 2001/07/10
[#13801] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — WATANABE Hirofumi <eban@...> 2001/07/10

わたなべです。

[#13802] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — matz@... (Yukihiro Matsumoto) 2001/07/10

まつもと ゆきひろです

[#13804] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — WATANABE Hirofumi <eban@...> 2001/07/10

わたなべです。

[#13805] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — matz@... (Yukihiro Matsumoto) 2001/07/10

まつもと ゆきひろです

[#13806] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — WATANABE Hirofumi <eban@...> 2001/07/10

わたなべです。

[#13807] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — matz@... (Yukihiro Matsumoto) 2001/07/10

まつもと ゆきひろです

[#13808] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — "Akinori MUSHA" <knu@...> 2001/07/10

At Tue, 10 Jul 2001 15:23:04 +0900,

[#13809] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — WATANABE Hirofumi <eban@...> 2001/07/10

わたなべです。

[#13810] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — "Akinori MUSHA" <knu@...> 2001/07/10

At Tue, 10 Jul 2001 16:50:52 +0900,

[#13811] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi(). — "Akinori MUSHA" <knu@...> 2001/07/10

 もうひとつあった。

[#13828] supported platforms / K&R — "Akinori MUSHA" <knu@...>

 digest モジュールの各プラットフォームでの動作確認をお願いした

39 messages 2001/07/13
[#14389] Re: supported platforms / K&R — Koji Arai <JCA02266@...> 2001/08/08

新井です。

[#14399] Re: supported platforms / K&R — Takashi Shimizu <simtak@...> 2001/08/09

清水@biglobeです。

[#14404] Re: supported platforms / K&R — Koji Arai <JCA02266@...> 2001/08/09

新井です。

[#14461] Re: supported platforms / K&R — Takashi Shimizu <simtak@...> 2001/08/14

清水@biglobe です。

[#14466] Re: supported platforms / K&R — nobu.nakada@... 2001/08/14

なかだです。

[#14468] Re: supported platforms / K&R — Koji Arai <JCA02266@...> 2001/08/14

新井です。

[#14477] recursive malloc (Re: supported platforms / K&R) — Koji Arai <JCA02266@...> 2001/08/15

新井です。

[#14482] Re: recursive malloc (Re: supported platforms / K&R) — nobu.nakada@... 2001/08/15

なかだです。

[#14486] Re: recursive malloc (Re: supported platforms / K&R) — Koji Arai <JCA02266@...> 2001/08/15

新井です。

[#14490] Re: recursive malloc (Re: supported platforms/ K&R) — nobu.nakada@... 2001/08/15

なかだです。

[#14492] Re: recursive malloc (Re: supported platforms/ K&R) — Koji Arai <JCA02266@...> 2001/08/15

新井です。

[#14493] Re: recursive malloc (Re: supportedplatforms/ K&R) — nobu.nakada@... 2001/08/15

なかだです。

[#13878] Prototype for rb_gc_mark / volatile in ruby.h — Tietew <tietew@...>

Tietew です。

18 messages 2001/07/15
[#13880] Re: Prototype for rb_gc_mark / volatile in ruby.h — matz@... (Yukihiro Matsumoto) 2001/07/16

まつもと ゆきひろです

[#13940] IO#read — "Akinori MUSHA" <knu@...>

 IO#read を使って何度もストリームから読み込むような処理をする

20 messages 2001/07/19

[#13959] Re: [ruby-list:30682] Re: overwride method — "Akinori MUSHA" <knu@...>

At Fri, 20 Jul 2001 21:09:36 +0900,

95 messages 2001/07/20
[#13963] Re: [ruby-list:30682] Re: overwride method — GOTO Kentaro <gotoken@...> 2001/07/20

ごとけんです

[#13965] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/21

まつもと ゆきひろです

[#13967] Re: [ruby-list:30682] Re: overwride method — GOTO Kentaro <gotoken@...> 2001/07/21

ごとけんです

[#13969] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/21

まつもと ゆきひろです

[#13980] Re: [ruby-list:30682] Re: overwride method — GOTO Kentaro <gotoken@...> 2001/07/21

[ruby-dev:13969]>

[#13981] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/21

まつもと ゆきひろです

[#13984] Re: [ruby-list:30682] Re: overwride method — GOTO Kentaro <gotoken@...> 2001/07/22

ごとけんです

[#13993] Re: [ruby-list:30682] Re: overwride method — "NAKAMURA, Hiroshi" <nakahiro@...> 2001/07/23

なひです。

[#13994] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/23

まつもと ゆきひろです

[#13995] Re: [ruby-list:30682] Re: overwride method — keiju@... (石塚圭樹) 2001/07/23

けいじゅ@日本ラショナルソフトウェアです.

[#13996] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/23

まつもと ゆきひろです

[#13997] Re: [ruby-list:30682] Re: overwride method — keiju@... (石塚圭樹) 2001/07/23

けいじゅ@日本ラショナルソフトウェアです.

[#13998] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/23

まつもと ゆきひろです

[#14000] Re: [ruby-list:30682] Re: overwride method — "NAKAMURA, Hiroshi" <nakahiro@...> 2001/07/23

なひです。

[#14005] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/23

まつもと ゆきひろです

[#14016] Re: [ruby-list:30682] Re: overwride method — "NAKAMURA, Hiroshi" <nakahiro@...> 2001/07/24

なひです。

[#14021] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14022] Re: [ruby-list:30682] Re: overwride method — "NAKAMURA, Hiroshi" <nakahiro@...> 2001/07/24

なひです。

[#14023] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14037] Re: [ruby-list:30682] Re: overwride method — GOTO Kentaro <gotoken@...> 2001/07/24

ごとけんです

[#14039] Re: [ruby-list:30682] Re: overwride method — Masatoshi SEKI <m_seki@...> 2001/07/24

[#14040] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14043] Re: [ruby-list:30682] Re: overwride method — m_seki@... 2001/07/24

[#14053] Re: [ruby-list:30682] Re: overwride method — matz@... (Yukihiro Matsumoto) 2001/07/25

まつもと ゆきひろです

[#14082] private instance variable と _dump/_load — Masatoshi SEKI <m_seki@...> 2001/07/25

[#14084] Re: private instance variable と _dump/_load — keiju@... (石塚圭樹) 2001/07/25

けいじゅ@日本ラショナルソフトウェアです.

[#14087] Re: private instance variable と _dump/_load — matz@... (Yukihiro Matsumoto) 2001/07/25

まつもと ゆきひろです

[#14089] Re: private instance variable と _dump/_load — keiju@... (石塚圭樹) 2001/07/25

けいじゅ@日本ラショナルソフトウェアです.

[#14094] Re: private instance variable と _dump/_load — matz@... (Yukihiro Matsumoto) 2001/07/26

まつもと ゆきひろです

[#14133] Re: private instance variable と _dump/_load — "Shin'ya Adzumi" <adzumi@...> 2001/07/27

あづみです。

[#14134] Re: private instance variable と _dump/_load — matz@... (Yukihiro Matsumoto) 2001/07/27

まつもと ゆきひろです

[#14140] Re: private instance variable と _dump/_load — Kazuhiro NISHIYAMA <zn@...> 2001/07/27

In <996211878.306635.31396.nullmailer@ev.netlab.jp>

[#14143] Re: private instance variable と _dump/_load — matz@... (Yukihiro Matsumoto) 2001/07/27

まつもと ゆきひろです

[#14144] Re: private instance variable と _dump/_load — Kazuhiro NISHIYAMA <zn@...> 2001/07/27

In <996255758.830993.629.nullmailer@ev.netlab.jp>

[#14066] Re: [ruby-list:30682] Re: overwride method — "Shin'ya Adzumi" <adzumi@...> 2001/07/25

あづみです。

[#14068] private instance variable (Re: Re: overwride method) — matz@... (Yukihiro Matsumoto) 2001/07/25

まつもと ゆきひろです

[#14099] Is private instance variable really needed? — Shugo Maeda <shugo@...> 2001/07/26

前田です。

[#14104] Re: Is private instance variable really needed? — matz@... (Yukihiro Matsumoto) 2001/07/26

まつもと ゆきひろです

[#14026] Exception in coerce — Shin-ichiro HARA <sinara@...>

原です。

21 messages 2001/07/24
[#14027] Re: Exception in coerce — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14028] Re: Exception in coerce — Shin-ichiro HARA <sinara@...> 2001/07/24

原です。

[#14029] Re: Exception in coerce — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14030] Re: Exception in coerce — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[#14031] Re: Exception in coerce — Shin-ichiro HARA <sinara@...> 2001/07/24

原です。

[#14032] Re: Exception in coerce — matz@... (Yukihiro Matsumoto) 2001/07/24

まつもと ゆきひろです

[ruby-dev:13810] Re: [ruby-cvs] ruby: * ruby.h: fix a wrong function name: rb_iglob() -> rb_globi().

From: "Akinori MUSHA" <knu@...>
Date: 2001-07-10 08:57:36 UTC
List: ruby-dev #13810
At Tue, 10 Jul 2001 16:50:52 +0900,
WATANABE Hirofumi wrote:
> "Akinori MUSHA" <knu@iDaemons.org> writes:
> 
> : 今のところ、拡張ライブラリ等で rb_glob() / rb_globi を使って
> :いるものはないようですし(あってもごく一部)、この際変更してしまい
> :ましょうか。(先のパッチの rb_glob_with_flags() を新しい rb_glob()
> :とする)
> 
> 元々rb_iglob()はwin32/win32.cで使うために作ったので、
> rb_glob_with_flags()がrb_glob()になるなら
> rb_globi()は廃止しても問題ないはずです。

 ということは、 FNM_* も外部に見せないといけないので、次のような
変更でいかがでしょうか。

	- rb_glob() に引数を追加し、 flags を受け付けるようにする。
	- rb_globi() は廃止。
	- 必然的に FNM_* を外部公開する必要ができるが、そのまま
	  ではシステムのマクロとぶつかるので、 R_FNM_* として公開。
	- せっかくなので dir.c#fnmatch() も rb_fnmatch() と改名の
	  上で外部公開。
	- Dir::glob(pattern, flags = File::FNM_PERIOD) とし、
	  オプションとして flags を受け付けるようにする。
	- Dir[*patterns] とし、複数のパターンを受け付けるが、
	  flags は受けとらない。


 やはり Dir::glob() で複数のパターンを取れないのは仕方ないかな。
glob.rb を rough に入れてみなさんにつついてもらおう。。

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"Freeze this moment a little bit longer, make each impression
  a little bit stronger..  Experience slips away -- Time stand still"

Index: dir.c
===================================================================
RCS file: /src/ruby/dir.c,v
retrieving revision 1.49
diff -u -r1.49 dir.c
--- dir.c	2001/07/02 08:46:21	1.49
+++ dir.c	2001/07/10 08:39:40
@@ -65,14 +65,6 @@
 #define lstat(path,st) stat(path,st)
 #endif
 
-#define FNM_NOESCAPE	0x01
-#define FNM_PATHNAME	0x02
-#define FNM_PERIOD	0x04
-#define FNM_CASEFOLD	0x08
-
-#define FNM_NOMATCH	1
-#define FNM_ERROR	2
-
 #define downcase(c) (nocase && ISUPPER(c) ? tolower(c) : (c))
 
 #if defined DOSISH
@@ -100,8 +92,8 @@
     int flags;
 {
     int not, ok = 0;
-    int nocase = flags & FNM_CASEFOLD;
-    int escape = !(flags & FNM_NOESCAPE);
+    int nocase = flags & R_FNM_CASEFOLD;
+    int escape = !(flags & R_FNM_NOESCAPE);
 
     not = *pat == '!' || *pat == '^';
     if (not)
@@ -133,8 +125,8 @@
 #define ISDIRSEP(c) (pathname && isdirsep(c))
 #define PERIOD(s) (period && *(s) == '.' && \
 		  ((s) == string || ISDIRSEP((s)[-1])))
-static int
-fnmatch(pat, string, flags)
+int
+rb_fnmatch(pat, string, flags)
     const char *pat;
     const char *string;
     int flags;
@@ -142,16 +134,16 @@
     int c;
     int test;
     const char *s = string;
-    int escape = !(flags & FNM_NOESCAPE);
-    int pathname = flags & FNM_PATHNAME;
-    int period = flags & FNM_PERIOD;
-    int nocase = flags & FNM_CASEFOLD;
+    int escape = !(flags & R_FNM_NOESCAPE);
+    int pathname = flags & R_FNM_PATHNAME;
+    int period = flags & R_FNM_PERIOD;
+    int nocase = flags & R_FNM_CASEFOLD;
 
     while (c = *pat++) {
 	switch (c) {
 	case '?':
 	    if (!*s || ISDIRSEP(*s) || PERIOD(s))
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 	    s++;
 	    break;
 	case '*':
@@ -159,11 +151,11 @@
 		;
 
 	    if (PERIOD(s))
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 
 	    if (!c) {
 		if (pathname && find_dirsep(s))
-		    return FNM_NOMATCH;
+		    return R_FNM_NOMATCH;
 		else
 		    return 0;
 	    }
@@ -171,7 +163,7 @@
 		s = find_dirsep(s);
 		if (s)
 		    break;
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 	    }
 
 	    test = escape && c == '\\' ? *pat : c;
@@ -179,20 +171,20 @@
 	    pat--;
 	    while (*s) {
 		if ((c == '[' || downcase(*s) == test) &&
-		    !fnmatch(pat, s, flags & ~FNM_PERIOD))
+		    !rb_fnmatch(pat, s, flags & ~R_FNM_PERIOD))
 		    return 0;
 		else if (ISDIRSEP(*s))
 		    break;
 		s++;
 	    }
-	    return FNM_NOMATCH;
+	    return R_FNM_NOMATCH;
       
 	case '[':
 	    if (!*s || ISDIRSEP(*s) || PERIOD(s))
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 	    pat = range(pat, *s, flags);
 	    if (!pat)
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 	    s++;
 	    break;
 
@@ -217,12 +209,12 @@
 	    else
 #endif
 	    if(downcase(c) != downcase(*s))
-		return FNM_NOMATCH;
+		return R_FNM_NOMATCH;
 	    s++;
 	    break;
 	}
     }
-    return !*s ? 0 : FNM_NOMATCH;
+    return !*s ? 0 : R_FNM_NOMATCH;
 }
 
 VALUE rb_cDir;
@@ -530,7 +522,7 @@
     register char *p = s;
     register char c;
     int open = 0;
-    int escape = !(flags & FNM_NOESCAPE);
+    int escape = !(flags & R_FNM_NOESCAPE);
 
     while ((c = *p++) != '\0') {
 	switch (c) {
@@ -706,7 +698,7 @@
 		    free(buf);
 		    continue;
 		}
-		if (fnmatch(magic, dp->d_name, flags) == 0) {
+		if (rb_fnmatch(magic, dp->d_name, flags) == 0) {
 		    buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+2);
 		    sprintf(buf, "%s%s%s", base, (BASE)?"/":"", dp->d_name);
 		    if (!m) {
@@ -752,25 +744,15 @@
 }
 
 void
-rb_glob(path, func, arg)
+rb_glob(path, flags, func, arg)
     char *path;
+    int flags;
     void (*func) _((const char*, VALUE));
     VALUE arg;
-{
-    glob_helper(path, FNM_PERIOD, func, arg);
-}
-
-void
-rb_globi(path, func, arg)
-    char *path;
-    void (*func)();
-    VALUE arg;
 {
-    glob_helper(path, FNM_PERIOD|FNM_CASEFOLD, func, arg);
+    glob_helper(path, flags, func, arg);
 }
 
-static void push_pattern _((const char *path, VALUE ary));
-
 static void
 push_pattern(path, ary)
     const char *path;
@@ -778,26 +760,28 @@
 {
     VALUE str = rb_tainted_str_new2(path);
 
-    if (ary) {
-	rb_ary_push(ary, str);
+    if (NIL_P(ary)) {
+	rb_yield(str);
     }
     else {
-	rb_yield(str);
+	rb_ary_push(ary, str);
     }
 }
 
 static void
-push_globs(ary, s)
+push_globs(ary, s, flags)
     VALUE ary;
     char *s;
+    int flags;
 {
-    rb_glob(s, push_pattern, ary);
+    rb_glob(s, flags, push_pattern, ary);
 }
 
 static void
-push_braces(ary, s)
+push_braces(ary, s, flags)
     VALUE ary;
     char *s;
+    int flags;
 {
     char buffer[MAXPATHLEN], *buf = buffer;
     char *p, *t, *b;
@@ -837,32 +821,32 @@
 	    }
 	    memcpy(b, t, p-t);
 	    strcpy(b+(p-t), rbrace+1);
-	    push_braces(ary, buf);
+	    push_braces(ary, buf, flags);
 	}
 	if (buf != buffer)
 	    free(buf);
     }
     else {
-	push_globs(ary, s);
+	push_globs(ary, s, flags);
     }
 }
 
 #define isdelim(c) ((c)=='\0')
 
 static VALUE
-dir_s_glob(dir, str)
-    VALUE dir, str;
+rb_push_glob(ary, str, flags)
+    VALUE ary;
+    VALUE str;
+    int flags;
 {
     char *p, *pend;
     char buffer[MAXPATHLEN], *buf;
     char *t;
     int nest;
-    VALUE ary = 0;
+    int noescape = flags & R_FNM_NOESCAPE;
 
     SafeStringValue(str);
-    if (!rb_block_given_p()) {
-	ary = rb_ary_new();
-    }
+
     if (RSTRING(str)->len >= MAXPATHLEN) {
 	buf = xmalloc(RSTRING(str)->len + 1);
     } else {
@@ -879,7 +863,7 @@
 	while (p < pend && !isdelim(*p)) {
 	    if (*p == '{') nest+=2;
 	    if (*p == '}') nest+=3;
-	    if (*p == '\\') {
+	    if (!noescape && *p == '\\') {
 		*t++ = *p++;
 		if (p == pend) break;
 	    }
@@ -887,22 +871,67 @@
 	}
 	*t = '\0';
 	if (nest == 0) {
-	    push_globs(ary, buf);
+	    push_globs(ary, buf, flags);
 	}
 	else if (nest % 5 == 0) {
-	    push_braces(ary, buf);
+	    push_braces(ary, buf, flags);
 	}
 	/* else unmatched braces */
     }
     if (buf != buffer)
 	free(buf);
-    if (ary && RARRAY(ary)->len == 0) {
+    if (!NIL_P(ary) && RARRAY(ary)->len == 0) {
 	rb_warning("no matches found: %s", RSTRING(str)->ptr);
     }
     return ary;
 }
 
 static VALUE
+dir_s_glob(argc, argv, obj)
+    int argc;
+    VALUE *argv;
+    VALUE obj;
+{
+    VALUE str, rflags;
+    int flags;
+    int noescape;
+    VALUE ary;
+
+    if (rb_scan_args(argc, argv, "11", &str, &rflags) == 2)
+	flags = NUM2INT(rflags);
+    else
+	flags = R_FNM_PERIOD;
+
+    noescape = flags & R_FNM_NOESCAPE;
+
+    if (rb_block_given_p()) {
+	ary = Qnil;
+    } else {
+	ary = rb_ary_new();
+    }
+
+    return rb_push_glob(ary, str, flags);
+}
+
+static VALUE
+dir_s_aref(argc, argv, obj)
+    int argc;
+    VALUE *argv;
+    VALUE obj;
+{
+    VALUE str, rflags;
+    int flags;
+    VALUE ary;
+
+    ary = rb_ary_new();
+
+    while (argc--)
+	rb_push_glob(ary, *argv++, R_FNM_PERIOD);
+
+    return ary;
+}
+
+static VALUE
 dir_foreach(io, dirname)
     VALUE io, dirname;
 {
@@ -941,7 +970,7 @@
     StringValue(pattern);
     StringValue(path);
 
-    if (fnmatch(RSTRING(pattern)->ptr, RSTRING(path)->ptr, flags) == 0)
+    if (rb_fnmatch(RSTRING(pattern)->ptr, RSTRING(path)->ptr, flags) == 0)
 	return Qtrue;
 
     return Qfalse;
@@ -978,14 +1007,14 @@
     rb_define_singleton_method(rb_cDir,"delete", dir_s_rmdir, 1);
     rb_define_singleton_method(rb_cDir,"unlink", dir_s_rmdir, 1);
 
-    rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, 1);
-    rb_define_singleton_method(rb_cDir,"[]", dir_s_glob, 1);
+    rb_define_singleton_method(rb_cDir,"glob", dir_s_glob, -1);
+    rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
 
     rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
     rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);
 
-    rb_file_const("FNM_NOESCAPE", INT2FIX(FNM_NOESCAPE));
-    rb_file_const("FNM_PATHNAME", INT2FIX(FNM_PATHNAME));
-    rb_file_const("FNM_PERIOD", INT2FIX(FNM_PERIOD));
-    rb_file_const("FNM_CASEFOLD", INT2FIX(FNM_CASEFOLD));
+    rb_file_const("FNM_NOESCAPE", INT2FIX(R_FNM_NOESCAPE));
+    rb_file_const("FNM_PATHNAME", INT2FIX(R_FNM_PATHNAME));
+    rb_file_const("FNM_PERIOD", INT2FIX(R_FNM_PERIOD));
+    rb_file_const("FNM_CASEFOLD", INT2FIX(R_FNM_CASEFOLD));
 }
Index: ruby.h
===================================================================
RCS file: /src/ruby/ruby.h,v
retrieving revision 1.49
diff -u -r1.49 ruby.h
--- ruby.h	2001/07/08 11:53:37	1.49
+++ ruby.h	2001/07/10 08:39:40
@@ -416,8 +416,16 @@
 #define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))
 #define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n))
 
-void rb_glob _((char*,void(*)(const char*,VALUE),VALUE));
-void rb_globi _((char*,void(*)(const char*,VALUE),VALUE));
+#define R_FNM_NOESCAPE	0x01
+#define R_FNM_PATHNAME	0x02
+#define R_FNM_PERIOD	0x04
+#define R_FNM_CASEFOLD	0x08
+
+#define R_FNM_NOMATCH	1
+#define R_FNM_ERROR	2
+
+void rb_glob _((char*,int,void(*)(const char*,VALUE),VALUE));
+int rb_fnmatch _((const char *pat, const char *, int));
 
 VALUE rb_define_class _((const char*,VALUE));
 VALUE rb_define_module _((const char*));
Index: util.c
===================================================================
RCS file: /src/ruby/util.c,v
retrieving revision 1.18
diff -u -r1.18 util.c
--- util.c	2001/05/02 04:22:11	1.18
+++ util.c	2001/07/10 08:39:40
@@ -355,7 +355,7 @@
     info.count = 0;
     info.head = 0;
 
-    rb_globi(buf, push_element, (VALUE)&info);
+    rb_glob(buf, R_FNM_PERIOD|R_FNM_CASEFOLD, push_element, (VALUE)&info);
 
     if (buf != path_buffer)
 	ruby_xfree(buf);
Index: win32/win32.c
===================================================================
RCS file: /src/ruby/win32/win32.c,v
retrieving revision 1.45
diff -u -r1.45 win32.c
--- win32/win32.c	2001/05/12 06:47:24	1.45
+++ win32/win32.c	2001/07/10 08:39:41
@@ -1005,7 +1005,7 @@
     for (p = buf; *p; p = CharNext(p))
 	if (*p == '\\')
 	    *p = '/';
-    rb_globi(buf, insert, (VALUE)&listinfo);
+    rb_glob(buf, R_FNM_PERIOD|R_FNM_CASEFOLD, insert, (VALUE)&listinfo);
     if (buf != buffer)
 	free(buf);
 

In This Thread