summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_env.rb1
-rw-r--r--version.h2
-rw-r--r--win32/win32.c4
4 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 10349a548e..f895bf8e5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Sep 30 16:11:08 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_getenv): should return NULL if specified name
+ is empty. a patch from Heesob Park at [ruby-core:32650]
+
Sun Aug 29 13:22:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm.c (rb_thread_method_id_and_class): curried proc has no
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index fb7f1cd694..dc3b7c6d39 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -96,6 +96,7 @@ class TestEnv < Test::Unit::TestCase
assert_raise(ArgumentError) { ENV["foo\0bar"] }
ENV[PATH_ENV] = ""
assert_equal("", ENV[PATH_ENV])
+ assert_nil(ENV[""])
end
def test_fetch
diff --git a/version.h b/version.h
index d492f33902..32a63adad3 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 55
+#define RUBY_PATCHLEVEL 56
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
diff --git a/win32/win32.c b/win32/win32.c
index c3bd4dcf55..94b67206b8 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3876,8 +3876,8 @@ rb_w32_getenv(const char *name)
int len = strlen(name);
char *env;
- if (envarea)
- FreeEnvironmentStrings(envarea);
+ if (len == 0) return NULL;
+ if (envarea) FreeEnvironmentStrings(envarea);
envarea = GetEnvironmentStrings();
if (!envarea) {
map_errno(GetLastError());