summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 08:05:33 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-02 08:05:33 +0000
commit0a04644bd217e2aec0580d7de9629bf0cf0b88f6 (patch)
tree6ea35ff98235b28d1dd3dc2cd3a699b69d5f46ce
parent37309d99a72fe18a6383658fe3898ed2e2295076 (diff)
merges r29378 from trunk into ruby_1_9_2.
-- * win32/win32.c (rb_w32_getenv): should return NULL if specified name is empty. a patch from Heesob Park at [ruby-core:32650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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());