diff options
author | arton <arton@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-19 08:10:08 +0000 |
---|---|---|
committer | arton <arton@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-19 08:10:08 +0000 |
commit | 812550b977e2114d74212ee211e520baee8760f3 (patch) | |
tree | 34b8dbe4fd78a2c24ee14a914f75525764fbf47e /hash.c | |
parent | b86e5f851744df466acdecd54a945dff11793715 (diff) | |
download | ruby-812550b977e2114d74212ee211e520baee8760f3.tar.gz |
* hash.c (ruby_setenv): checking with max process environment block size fow Win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2206,7 +2206,12 @@ ruby_setenv(const char *name, const char *value) rb_sys_fail("ruby_setenv"); } if (value) { - if (strlen(value) > 5120) goto fail; + char* p = GetEnvironmentStringsA(); + if (p) { + if (strlen(value) + strlen(p) >= 32767) goto fail; + } else { + if (strlen(value) >= 5120) goto fail; + } buf = rb_sprintf("%s=%s", name, value); } else { |