I'm committing the patch which fixes a bug in System.getenv()
when an environment variable has an empty value.

Changelog:

2006-06-04  Andrew John Hughes  <[EMAIL PROTECTED]>

        * java/lang/System.java:
        (getenv()): Handle cases where split only
        returns an array of size 1.

-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

If you use Microsoft Office, support movement towards the end of vendor lock-in:
http://opendocumentfellowship.org/petition/

"Value your freedom, or you will lose it, teaches history. 
`Don't bother us with politics' respond those who don't want to learn." 
-- Richard Stallman

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: java/lang/System.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/System.java,v
retrieving revision 1.38.2.19
diff -u -3 -p -u -r1.38.2.19 System.java
--- java/lang/System.java       3 Jun 2006 16:02:08 -0000       1.38.2.19
+++ java/lang/System.java       4 Jun 2006 15:35:55 -0000
@@ -549,7 +549,10 @@ public final class System
        for (String pair : environ)
          {
            String[] parts = pair.split("=");
-           variables.put(parts[0], parts[1]);
+           if (parts.length == 2)
+             variables.put(parts[0], parts[1]);
+           else
+             variables.put(parts[0], "");
          }
        environmentMap = Collections.unmodifiableMap(variables);
       }

Attachment: signature.asc
Description: Digital signature

Reply via email to