[#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:13847] Re: DOSISH file.c changes

From: "U.Nakamura" <usa@...>
Date: 2001-07-13 14:46:26 UTC
List: ruby-dev #13847
こんにちは、なかむら(う)です。

At Fri, 13 Jul 2001 22:56:10 +0900, nobu.nakada@nifty.ne.jp wrote in
    '[ruby-dev:13845] Re: Fw: DOSISH file.c changes'
> (1) is_absolute_path()がc:hogeみたいのに対して偽を返すようになっ
>     てるので、require 'c:hoge'なんてのがエラーになりそうな気が
>     するんですが、そういうもん? これはどちらかといえば
>     is_macos_native_path()と同様の扱いにしたほうがいいようにも
>     思えますが。

c:hogeみたいのがabsoluteなpathじゃないというのは正しいように
私は思うのですが、どうでしょう?
ただし、

> (2) rb_file_s_expand_path()でis_absolute_path()で分岐しているけ
>     れど、ドライブレターを考えたときには絶対パスかどうかという
>     分け方はできないと思うので、それぞれのパターンについて分岐
>     したほうがいいのでは。

これは当然だと思います。


> (3) パッチが壊れてるとか。

あぅ、壊れてましたか...
道理でパッチがあたらんわけだ。
# 自分の環境がおかしいと思い込んでました


さて、なかださんのパッチですが、コンパイル通らないです。
getdrivecurdir()の引数の数と、driveという引数があるのに同じ
名前のローカル変数があるのがまずいです。
で、これを回避しても、File.dirname('d:hoge')で落ちます。うー
ん。

ところで、僕もCheng氏のパッチをいじってたのですが、とりあえ
ずつけときます。なんか後出しはずるい感じがしますが :-P

で、いずれのパッチでも言えることですが、File.dirname('c:/hoge')
が'c:/'を返すので(これはわざとですけど)、
  File.join(File.dirname('c:/hoge'), File.basename('c:/hoge'))
が'c://hoge'になります。むーんむーん。


Index: file.c
===================================================================
RCS file: /src/ruby/file.c,v
retrieving revision 1.58
diff -u -p -r1.58 file.c
--- file.c	2001/06/19 04:35:13	1.58
+++ file.c	2001/07/13 04:08:56
@@ -69,11 +69,13 @@ char *strrchr _((const char*,const char)
 #ifndef HAVE_LSTAT
 #define lstat(path,st) stat(path,st)
 #endif
- 
+
 VALUE rb_cFile;
 VALUE rb_mFileTest;
 static VALUE rb_cStat;
 
+static int is_absolute_path(path);
+
 static int
 apply2files(func, vargs, arg)
     int (*func)();
@@ -1345,14 +1347,62 @@ rb_file_s_expand_path(argc, argv)
 	}
     }
 #if defined DOSISH
-    /* skip drive letter */
-    else if (ISALPHA(s[0]) && s[1] == ':' && isdirsep(s[2])) {
-	while (*s && !isdirsep(*s)) {
-	    *p++ = *s++;
-	}
+    else if (ISALPHA(s[0]) && s[1] == ':') {
+        if (isdirsep(s[2])) {
+            /* specified drive letter, and full path */
+            /* skip drive letter */
+            while (*s && !isdirsep(*s)) {
+                *p++ = *s++;
+            }
+        }
+        else {
+            /* specified drive, but not full path */
+            char drive[3];
+            char oldcwd[MAXPATHLEN+1];
+
+            drive[0] = *s++;
+            drive[1] = *s++;
+            drive[2] = '\0';
+
+            /* the only way that I know to get the current directory
+               of a particular drive is to change chdir() to that drive,
+               so save the old cwd before chdir()
+            */
+            getcwd(oldcwd, MAXPATHLEN);
+            chdir(drive);
+
+            tainted = 1;
+            getcwd(buf, MAXPATHLEN);
+            p = &buf[strlen(buf)];
+            if ( *s )
+            {
+                /* need to append '/' before appending the rest of the path */
+                if (! isdirsep(*(p - 1))) *p++ = '/';
+                while (*s && !isdirsep(*s)) {
+                    *p++ = *s++;
+                }
+            }
+            chdir(oldcwd);
+        }
     }
+#endif
+#if defined DOSISH && ! defined(__CYGWIN__)
+    else if (isdirsep(*s) && !is_absolute_path(s)) {
+        /* specified full path, but not drive letter */
+        /* we need to get the drive letter */
+        tainted = 1;
+#ifdef HAVE_GETCWD
+        getcwd(buf, MAXPATHLEN);
+#else
+	getwd(buf);
 #endif
-    else if (!isdirsep(*s)) {
+        p = &buf[2];
+        while (*s && !isdirsep(*s)) {
+            *p++ = *s++;
+        }
+    }
+#endif
+    else if (!is_absolute_path(s)) {
 	if (!NIL_P(dname)) {
 	    dname = rb_file_s_expand_path(1, &dname);
 	    if (OBJ_TAINTED(dname)) tainted = 1;
@@ -1367,7 +1417,7 @@ rb_file_s_expand_path(argc, argv)
 #endif
 	}
 	p = &buf[strlen(buf)];
-	while (p > buf && *(p - 1) == '/') p--;
+	while (p > buf && isdirsep(*(p - 1))) p--;
     }
     else {
 	while (*s && isdirsep(*s)) {
@@ -1384,7 +1434,7 @@ rb_file_s_expand_path(argc, argv)
 	    if (*(s+1)) {
 		switch (*++s) {
 		  case '.':
-		    if (*(s+1) == '\0' || isdirsep(*(s+1))) { 
+		    if (*(s+1) == '\0' || isdirsep(*(s+1))) {
 			/* We must go back to the parent */
 			if (isdirsep(*p) && p > buf) p--;
 			while (p > buf && !isdirsep(*p)) p--;
@@ -1399,7 +1449,7 @@ rb_file_s_expand_path(argc, argv)
 #if defined DOSISH
 		  case '\\':
 #endif
-		    if (!isdirsep(*p)) *++p = '/'; 
+		    if (!isdirsep(*p)) *++p = '/';
 		    break;
 		  default:
 		    *++p = '.'; *++p = *s; break;
@@ -1415,9 +1465,16 @@ rb_file_s_expand_path(argc, argv)
 	    *++p = *s;
 	}
     }
-  
+
     /* Place a \0 at end. If path ends with a "/", delete it */
     if (p == buf || !isdirsep(*p)) p++;
+#if defined(DOSISH)
+    if (ISALPHA(buf[0]) && buf[1] == ':' && isdirsep(buf[2])) {
+        /* root directory needs a trailing backslash,
+            otherwise it mean the current directory of the drive */
+        if (p == (buf+2)) p++;
+    }
+#endif
     *p = '\0';
 
     fname = rb_str_new2(buf);
@@ -1448,6 +1505,20 @@ rmext(p, e)
     return 0;
 }
 
+
+static char *
+strrdirsep(name)
+    char *name;
+{
+    char *last = NULL;
+    do {
+        if (isdirsep(*name)) last = name;
+        name++;
+    }
+    while( *name );
+    return last;
+}
+
 static VALUE
 rb_file_s_basename(argc, argv)
     int argc;
@@ -1461,8 +1532,20 @@ rb_file_s_basename(argc, argv)
 	ext = StringValuePtr(fext);
     }
     name = StringValuePtr(fname);
-    p = strrchr(name, '/');
+    p = strrdirsep(name);
     if (!p) {
+#if defined(DOSISH)
+	if (ISALPHA(name[0]) && name[1] == ':') {
+	    name += 2;
+	    if (NIL_P(fext)) {
+		f = strlen(name);
+	    }
+	    else {
+		f = rmext(name, ext);
+	   }
+	}
+	else
+#endif
 	if (NIL_P(fext) || !(f = rmext(name, ext)))
 	    return fname;
 	basename = rb_str_new(name, f);
@@ -1488,12 +1571,23 @@ rb_file_s_dirname(klass, fname)
     VALUE dirname;
 
     name = StringValuePtr(fname);
-    p = strrchr(name, '/');
+    p = strrdirsep(name);
     if (!p) {
+#if defined(DOSISH)
+	if (ISALPHA(name[0]) && name[1] == ':') {
+	    dirname = rb_str_new(name, 2);
+	    OBJ_INFECT(dirname, fname);
+	    return dirname;
+	}
+#endif
 	return rb_str_new2(".");
     }
     if (p == name)
 	p++;
+#if defined(DOSISH)
+    if ( ISALPHA(name[0]) && name[1] == ':' && p == &name[2])
+        p++;
+#endif
     dirname = rb_str_new(name, p - name);
     if (OBJ_TAINTED(fname)) OBJ_TAINT(dirname);
     return dirname;
@@ -1795,15 +1889,15 @@ rb_f_test(argc, argv)
 	    if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
 		return Qtrue;
             return Qfalse;
-                        
+
 	  case '=':
 	    if (st1.st_mtime == st2.st_mtime) return Qtrue;
 	    return Qfalse;
-                        
+
 	  case '>':
 	    if (st1.st_mtime > st2.st_mtime) return Qtrue;
 	    return Qfalse;
-            
+
 	  case '<':
 	    if (st1.st_mtime < st2.st_mtime) return Qtrue;
 	    return Qfalse;
@@ -2121,10 +2215,12 @@ static int
 is_absolute_path(path)
     const char *path;
 {
-    if (path[0] == '/') return 1;
+#if ! defined(DOSISH) || defined(__CYGWIN__)
+     if (path[0] == '/') return 1;
+#endif
 # if defined DOSISH
-    if (path[0] == '\\') return 1;
-    if (strlen(path) > 2 && path[1] == ':') return 1;
+    if (strlen(path) > 3 && path[1] == ':' && isdirsep(path[2]) ) return 1;
+    if (strlen(path) > 2 && isdirsep(path[0]) && isdirsep(path[1]) ) return 1;
 # endif
     return 0;
 }
@@ -2155,7 +2251,7 @@ path_check_1(path)
            if (p) *p = '/';
 	    return 0;
 	}
-	s = strrchr(path, '/');
+	s = strrdirsep(path);
 	if (p) *p = '/';
 	if (!s || s == path) return 1;
 	p = s;
@@ -2174,7 +2270,7 @@ rb_path_check(path)
 
     p = path;
     pend = strchr(path, sep);
-    
+
     for (;;) {
 	int safe;
 


それでは。

--
U.Nakamura <usa@osb.att.ne.jp>

In This Thread