This patch moves the Hashtable tbl initialisation outside the loop in ExpandEnvironmentVariables() so that GetEnvironmentVariablesNoCase() is only called once.
It looks like this is what the author intended. -- Malcolm Parsons
Index: Environment.cs =================================================================== RCS file: /mono/mcs/class/corlib/System/Environment.cs,v retrieving revision 1.79 diff -u -p -r1.79 Environment.cs --- Environment.cs 22 Jul 2004 08:20:11 -0000 1.79 +++ Environment.cs 22 Jul 2004 19:55:23 -0000 @@ -294,8 +294,8 @@ namespace System PlatformID platform = Platform; StringBuilder result = new StringBuilder (); result.Append (name, 0, off1); + Hashtable tbl = null; do { - Hashtable tbl = null; string var = name.Substring (off1 + 1, off2 - off1 - 1); string value = GetEnvironmentVariable (var); if (value == null && (int) platform != 128) {