ruby-changes:19091
From: arton <ko1@a...>
Date: Sat, 19 Mar 2011 20:34:47 +0900 (JST)
Subject: [ruby-changes:19091] Ruby:r31129 (trunk): * hash.c (ruby_setenv): checking with max process environment block size fow Win32.
arton 2011-03-19 17:10:08 +0900 (Sat, 19 Mar 2011) New Revision: 31129 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31129 Log: * hash.c (ruby_setenv): checking with max process environment block size fow Win32. Modified files: trunk/ChangeLog trunk/hash.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31128) +++ ChangeLog (revision 31129) @@ -1,3 +1,9 @@ +Sat Mar 19 17:14:46 2011 Tajima Akio <artonx@y...> + + * hash.c (ruby_setenv): checking with max process environment + block size fow Win32. 32767 for 2000/XP, 2003. if failed to + read the block, then checking with 5120 for earlier Windows. + Sat Mar 19 12:30:25 2011 Tanaka Akira <akr@f...> * ext/openssl/ossl_x509revoked.c: parenthesize macro arguments. Index: hash.c =================================================================== --- hash.c (revision 31128) +++ hash.c (revision 31129) @@ -2206,7 +2206,12 @@ 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 { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/