小松です。

In the message of [ruby-dev:8735] Re: [mswin32] 100% CPU usage when use sleep
    on 1999/12/27 15:01:57 Katsuyuki Komatsu <komatsu / sarion.co.jp> wrote:
|||  [ruby-dev:8692]
|
|これは……まだ確認できていません。

[ruby-dev:8692]についてですが、

  o lib/find.rb: "x:\\"の対応
    元のものに[ruby-dev:8738]の変更を加えたもの
    # [ruby-dev:8755]によると採用済みかな?

  o win32/win32.c, win32/Makefile: opendir()の"x:", 2バイト目の'\\'対応
    [ruby-dev:8692]をそのまま
    さらにwin32/config.statusの@LIBS@にも変更を追加

  o win32/win32.h: リンケージ指定変更
    [ruby-dev:8711]のextern "C++"を使ったwin32/win32.hの変更

を採用してください。以下にまとめときます。

win32/win32.cのopendir()で使うようにしたCharPrev()に関しては
しばらく悩んでたんですが、思いつく限りでは問題ないだろう
という結論に達しました。

Fri Dec 24 10:26:47 1999 Koji Oda <oda / bsd1.qnes.nec.co.jp> * win32/win32.h: use "C++" linkage. Sun Dec 19 22:56:31 1999 KANEKO Naoshi <wbs01621 / mail.wbs.ne.jp> * lib/find.rb: support dosish root directory. * win32/Makefile: ditto. * win32/config.status: ditto. * win32/win32.c (opendir): ditto. * win32/win32.c (opendir): use CharPrev() to get last character of the directory name. diff -rup ruby-1.4.3.dist/lib/find.rb ruby-1.4.3/lib/find.rb --- ruby-1.4.3.dist/lib/find.rb Tue Oct 12 18:11:30 1999 +++ ruby-1.4.3/lib/find.rb Mon Dec 27 22:09:58 1999 @@ -17,7 +17,9 @@ module Find begin for f in d next if f =~ /^\.\.?$/ - if file == "/" then + if File::ALT_SEPARATOR and file =~ /^([\/\\]|[A-Za-z]:[\/\\]?)$/ then + f = file + f + elsif file == "/" then f = "/" + f else f = file + "/" + f diff -rup ruby-1.4.3.dist/win32/Makefile ruby-1.4.3/win32/Makefile --- ruby-1.4.3.dist/win32/Makefile Wed Dec 8 01:18:25 1999 +++ ruby-1.4.3/win32/Makefile Sun Dec 19 22:56:31 1999 @@ -18,7 +18,7 @@ LDFLAGS = $(CFLAGS) -Fm #LDFLAGS = $(CFLAGS) -Fm XLDFLAGS = #EXTLIBS = -LIBS = advapi32.lib wsock32.lib $(EXTLIBS) +LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS) MISSING = crypt.obj alloca.obj win32.obj isinf.obj isnan.obj LDSHARED = DLDFLAGS = diff -rup ruby-1.4.3.dist/win32/config.status ruby-1.4.3/win32/config.status --- ruby-1.4.3.dist/win32/config.status Wed Dec 8 01:16:36 1999 +++ ruby-1.4.3/win32/config.status Mon Dec 27 23:21:36 1999 @@ -7,7 +7,7 @@ s%@FFLAGS@%%g s%@DEFS@% -DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 -DRSHIFT=\(x,y\)\ \(\(x\)\>\>y\) -DFILE_COUNT=_cnt -DDLEXT=\".dll\" -DRUBY_LIB=\"/usr/local/lib/ruby/1.4\" -DRUBY_ARCHLIB=\"/usr/local/lib/ruby/1.4/i386-mswin32\" -DRUBY_PLATFORM=\"i386-mswin32\" %g s%@LDFLAGS@%%g -s%@LIBS@%advapi32.lib wsock32.lib%g +s%@LIBS@%user32.lib advapi32.lib wsock32.lib%g s%@exec_prefix@%${prefix}%g s%@prefix@%/usr/local%g s%@program_transform_name@%s,x,x,%g diff -rup ruby-1.4.3.dist/win32/win32.c ruby-1.4.3/win32/win32.c --- ruby-1.4.3.dist/win32/win32.c Tue Nov 9 12:57:28 1999 +++ ruby-1.4.3/win32/win32.c Sun Dec 19 22:46:25 1999 @@ -1245,8 +1245,10 @@ opendir(char *filename) // check to see if we\'ve got a directory // - if (stat (filename, &sbuf) < 0 || - sbuf.st_mode & _S_IFDIR == 0) { + if ((stat (filename, &sbuf) < 0 || + sbuf.st_mode & _S_IFDIR == 0) && + (!isalpha(filename[0]) || filename[1] != ':' || filename[2] != '\0' || + ((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) { return NULL; } @@ -1264,7 +1266,7 @@ opendir(char *filename) strcpy(scanname, filename); - if (index("/\\", *(scanname + strlen(scanname) - 1)) == NULL) + if (index("/\\:", *CharPrev(scanname, scanname + strlen(scanname))) == NULL) strcat(scanname, "/*"); else strcat(scanname, "*"); diff -rup ruby-1.4.3.dist/win32/win32.h ruby-1.4.3/win32/win32.h --- ruby-1.4.3.dist/win32/win32.h Fri Aug 13 14:45:20 1999 +++ ruby-1.4.3/win32/win32.h Fri Dec 24 10:26:47 1999 @@ -87,7 +87,7 @@ #undef leave #if defined(__cplusplus) -} +extern "C++" { #endif #include <stdio.h> @@ -103,7 +103,7 @@ #include <malloc.h> #if defined(__cplusplus) -extern "C" { +} #endif #define UIDTYPE int -- 小松克行 / Katsuyuki Komatsu <komatsu / sarion.co.jp>