Merge pull request #498 from Unroll-Me/master
[mono.git] / mcs / class / corlib / System / Environment.cs
index 301df431e2153d1e6c779e6f8b634c1a28d3694b..3f8878b0439bb5d04ba580ba6551da9fe9371d71 100644 (file)
@@ -56,7 +56,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 101;
+               private const int mono_corlib_version = 108;
 #pragma warning restore 169
 
                [ComVisible (true)]
@@ -366,6 +366,7 @@ namespace System {
                                // If value not found, add %FOO to stream,
                                //  and use the closing % for the next iteration.
                                // If value found, expand it in place of %FOO%
+                               int realOldOff2 = off2;
                                if (value == null) {
                                        result.Append ('%');
                                        result.Append (var);
@@ -389,7 +390,7 @@ namespace System {
                                // If value not found in current iteration, but a % was found for next iteration,
                                //  use text from current closing % to the next %.
                                else
-                                       textLen = off1 - oldOff2;
+                                       textLen = off1 - realOldOff2;
                                if(off1 >= oldOff2 || off1 == -1)
                                        result.Append (name, oldOff2+1, textLen);
                        } while (off2 > -1 && off2 < len);