山本です。 >|> @@ -1220,6 +1220,8 @@ glob_helper(path, dirsep, exist, isdir, >|> case MATCH_DIR: >|> match_dir = 1; >|> break; >|> + case RECURSIVE: >|> + /* FIXME: ignore? bug? */; >|> } >|> } >|> >| >|これは >|warning: enumeration value `RECURSIVE' not handled in switch >|というのが意図的なのかどうなのかわからなかったので、 >|コメントでメモしたままにしてしまっていました。 >| >|無視していいのならignoreとコメントに書いておいて、 >|こないはずならrb_bugにしておくのが良いのではないでしょうか。 > >これは山本さんに聞かないと分かんないなあ。 glob_make_pattern で連続する RECURSIVE は一つにまとめるように しているので、来たとしたらバグです。glob_helper もそれを前提に 組まれています。 Index: dir.c =================================================================== RCS file: /src/ruby/dir.c,v retrieving revision 1.140 diff -u -w -b -p -r1.140 dir.c --- dir.c 18 May 2005 08:41:50 -0000 1.140 +++ dir.c 28 Jun 2005 07:23:00 -0000 @@ -1220,6 +1220,8 @@ glob_helper(path, dirsep, exist, isdir, case MATCH_DIR: match_dir = 1; break; + case RECURSIVE: + rb_bug("continuous RECURSIVEs"); } } @@ -1234,7 +1236,6 @@ glob_helper(path, dirsep, exist, isdir, isdir = NO; } } - if (match_dir && isdir == UNKNOWN) { if (do_stat(path, &st) == 0) { exist = YES; @@ -1245,12 +1246,10 @@ glob_helper(path, dirsep, exist, isdir, isdir = NO; } } - if (match_all && exist == YES) { status = glob_call_func(func, path, arg); if (status) return status; } - if (match_dir && isdir == YES) { char *tmp = join_path(path, dirsep, ""); status = glob_call_func(func, tmp, arg); @@ -1612,7 +1611,6 @@ static VALUE dir_open_dir(path) VALUE path; { - struct dir_data *dp; VALUE dir = rb_funcall(rb_cDir, rb_intern("open"), 1, path); if (TYPE(dir) != T_DATA ||