[#20392] [BigDecimal] proposal to change specification — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>

斎藤と申します。

25 messages 2003/06/20
[#20407] Re: [BigDecimal] proposal to change specification — "Shigeo Kobayashi" <shigeo@...> 2003/06/22

小林です。

[#20447] [BigDecimal] renaming proposal — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>

斎藤です。

47 messages 2003/06/24
[#20621] Re: [BigDecimal] renaming proposal — "Shigeo Kobayashi" <shigeo@...> 2003/07/11

小林@MAILチェック中です。

[#20628] Re: [BigDecimal] renaming proposal — "Shigeo Kobayashi" <shigeo@...> 2003/07/11

小林です。

[ruby-dev:20378] Re: case sensitivity of the names of environment variables

From: "U.Nakamura" <usa@...>
Date: 2003-06-19 15:59:50 UTC
List: ruby-dev #20378
こんにちは、なかむら(う)です。

In message "[ruby-dev:20377] Re: case sensitivity of the names of environment variables"
    on Jun.20,2003 00:15:53, <usa@osb.att.ne.jp> wrote:
| > 区別します。例えばpathとPathとPATHには別の内容を設定できます。
| > また、dln.cにもありますように通常は path を使います。
| 
| 了解しました。対応します。

以下のようなパッチで対応しようと考えています。
hash.cで #ifdef が何度も出るのはくどいでしょうか?

Index: defines.h
===================================================================
RCS file: /home/cvs/ruby/defines.h,v
retrieving revision 1.29
diff -u -1 -p -r1.29 defines.h
--- defines.h	1 Jun 2003 12:58:56 -0000	1.29
+++ defines.h	19 Jun 2003 15:56:28 -0000
@@ -168,2 +168,12 @@ flush_register_windows(void)
 #if defined(__human68k__)
+#define PATH_ENV "path"
+#else
+#define PATH_ENV "PATH"
+#endif
+
+#if defined(DOSISH) || !defined(__human68k__)
+#define ENV_IGNORECASE
+#endif
+
+#if defined(__human68k__)
 #undef HAVE_RANDOM
Index: dln.c
===================================================================
RCS file: /home/cvs/ruby/dln.c,v
retrieving revision 1.51
diff -u -1 -p -r1.51 dln.c
--- dln.c	26 Mar 2003 11:28:39 -0000	1.51
+++ dln.c	19 Jun 2003 15:56:29 -0000
@@ -1593,7 +1593,3 @@ dln_find_exe(fname, path)
     if (!path) {
-#if defined(__human68k__)
-	path = getenv("path");
-#else
-	path = getenv("PATH");
-#endif
+	path = getenv(PATH_ENV);
     }
Index: hash.c
===================================================================
RCS file: /home/cvs/ruby/hash.c,v
retrieving revision 1.108
diff -u -1 -p -r1.108 hash.c
--- hash.c	19 Jun 2003 04:21:25 -0000	1.108
+++ hash.c	19 Jun 2003 15:56:29 -0000
@@ -1019,6 +1019,6 @@ env_delete(obj, name)
 	ruby_setenv(nam, 0);
-#ifdef DOSISH
-	if (strcasecmp(nam, "PATH") == 0) {
+#ifdef ENV_IGNORECASE
+	if (strcasecmp(nam, PATH_ENV) == 0) {
 #else
-	if (strcmp(nam, "PATH") == 0) {
+	if (strcmp(nam, PATH_ENV) == 0) {
 #endif
@@ -1055,6 +1055,6 @@ rb_f_getenv(obj, name)
     if (env) {
-#ifdef DOSISH
-	if (strcasecmp(nam, "PATH") == 0 && !rb_env_path_tainted())
+#ifdef ENV_IGNORECASE
+	if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
 #else
-	if (strcmp(nam, "PATH") == 0 && !rb_env_path_tainted())
+	if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
 #endif
@@ -1098,6 +1098,6 @@ env_fetch(argc, argv)
     }
-#ifdef DOSISH
-    if (strcasecmp(nam, "PATH") == 0 && !rb_env_path_tainted())
+#ifdef ENV_IGNORECASE
+    if (strcasecmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
 #else
-    if (strcmp(nam, "PATH") == 0 && !rb_env_path_tainted())
+    if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted())
 #endif
@@ -1118,3 +1118,3 @@ rb_env_path_tainted()
     if (path_tainted < 0) {
-	path_tainted_p(getenv("PATH"));
+	path_tainted_p(getenv(PATH_ENV));
     }
@@ -1133,4 +1133,4 @@ envix(nam)
 	if (
-#ifdef WIN32
-	    strnicmp(env[i],nam,len) == 0
+#ifdef ENV_IGNORECASE
+	    strncasecmp(env[i],nam,len) == 0
 #else
@@ -1150,3 +1150,3 @@ ruby_setenv(name, value)
 {
-#if defined(WIN32) && !defined(__CYGWIN32__)
+#if defined(_WIN32)
     /* The sane way to deal with the environment.
@@ -1261,3 +1261,7 @@ env_aset(obj, nm, val)
     ruby_setenv(name, value);
-    if (strcmp(name, "PATH") == 0) {
+#ifdef ENV_IGNORECASE
+    if (strcasecmp(name, PATH_ENV) == 0) {
+#else
+    if (strcmp(name, PATH_ENV) == 0) {
+#endif
 	if (OBJ_TAINTED(val)) {
@@ -1582,3 +1586,7 @@ env_has_value(dmy, value)
 	if (s) {
+#ifdef ENV_IGNORECASE
+	    if (strncasecmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
+#else
 	    if (strncmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
+#endif
 		FREE_ENVIRON(environ);
@@ -1605,3 +1613,7 @@ env_index(dmy, value)
 	if (s) {
+#ifdef ENV_IGNORECASE
+	    if (strncasecmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
+#else
 	    if (strncmp(s, RSTRING(value)->ptr, strlen(s)) == 0) {
+#endif
 		str = env_str_new(*env, s-*env-1);
Index: ruby.c
===================================================================
RCS file: /home/cvs/ruby/ruby.c,v
retrieving revision 1.77
diff -u -1 -p -r1.77 ruby.c
--- ruby.c	22 Apr 2003 11:58:08 -0000	1.77
+++ ruby.c	19 Jun 2003 15:56:29 -0000
@@ -728,3 +728,3 @@ proc_options(argc, argv)
 		if (!script) {
-		    script = dln_find_file(argv[0], getenv("PATH"));
+		    script = dln_find_file(argv[0], getenv(PATH_ENV));
 		}

それでは。
-- 
U.Nakamura <usa@osb.att.ne.jp>



In This Thread