summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--configure.in2
-rw-r--r--hash.c2
-rw-r--r--ruby.c11
4 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 2da9d4e..d2d0bbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,7 @@ Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
Tue Jan 31 00:10:26 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/syck/rubyext.c (syck_resolver_transfer): workaround for SEGV.
- ex: YAML.load("!map:B {}"). [ruby-core:7217]
+ ex: ruby -ryaml -e 'YAML.load("!map:B {}")' [ruby-core:7217]
Sat Jan 28 07:56:57 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
diff --git a/configure.in b/configure.in
index f13a2f4..7f305e5 100644
--- a/configure.in
+++ b/configure.in
@@ -444,7 +444,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
getgroups setgroups getpriority getrlimit dlopen sigprocmask\
sigaction _setjmp setsid telldir seekdir fchmod mktime timegm\
- cosh sinh tanh setuid setgid)
+ cosh sinh tanh setuid setgid setenv unsetenv)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
[use_setreuid=$enableval])
diff --git a/hash.c b/hash.c
index 09d866b..eec6a71 100644
--- a/hash.c
+++ b/hash.c
@@ -1812,7 +1812,7 @@ ruby_setenv(name, value)
* RTL's environ global variable directly yet.
*/
SetEnvironmentVariable(name,value);
-#elif defined __CYGWIN__
+#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV)
#undef setenv
#undef unsetenv
if (value)
diff --git a/ruby.c b/ruby.c
index f80c08b..7979051 100644
--- a/ruby.c
+++ b/ruby.c
@@ -971,7 +971,14 @@ VALUE rb_progname;
VALUE rb_argv;
VALUE rb_argv0;
-#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE) && !defined(DOSISH)
+#if defined(PSTAT_SETCMD) || defined(HAVE_SETPROCTITLE)
+#elif defined(_WIN32)
+#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV)
+#else
+#define USE_ENVSPACE_FOR_ARG0
+#endif
+
+#ifdef USE_ENVSPACE_FOR_ARG0
static struct {
char *begin, *end;
} envspace;
@@ -1047,7 +1054,7 @@ set_arg0(val, id)
break;
}
}
-#ifndef DOSISH
+#if defined(USE_ENVSPACE_FOR_ARG0)
if (s + 1 == envspace.begin) {
s = envspace.end;
ruby_setenv("", NULL); /* duplicate environ vars */