Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Stepanischev <Oleg.Stepanischev@tatar.ru>2014-06-26 22:24:34 +0400
committerOleg Stepanischev <Oleg.Stepanischev@tatar.ru>2014-06-26 22:24:34 +0400
commitf7b81bda13d482bdb07ece400021537311154746 (patch)
treebfa54ae87a129abc1111687a863026b6dd949ea6 /mcs/class/System.Json
parent429cdf17cf3a4887d9882380beebbf0d119e65ab (diff)
Added fix for Bug 20869
Diffstat (limited to 'mcs/class/System.Json')
-rw-r--r--mcs/class/System.Json/System.Json/JsonValue.cs4
-rw-r--r--mcs/class/System.Json/Test/System.Json/JsonValueTest.cs6
2 files changed, 8 insertions, 2 deletions
diff --git a/mcs/class/System.Json/System.Json/JsonValue.cs b/mcs/class/System.Json/System.Json/JsonValue.cs
index 1d16b88e3f4..39722f5c169 100644
--- a/mcs/class/System.Json/System.Json/JsonValue.cs
+++ b/mcs/class/System.Json/System.Json/JsonValue.cs
@@ -218,8 +218,8 @@ namespace System.Json
if (src [i] == '"' || src [i] == '\\') {
sb.Append (src, start, i - start);
sb.Append ('\\');
- sb.Append (src [i++]);
- start = i;
+ sb.Append (src [i]);
+ start = i + 1;
}
sb.Append (src, start, src.Length - start);
return sb.ToString ();
diff --git a/mcs/class/System.Json/Test/System.Json/JsonValueTest.cs b/mcs/class/System.Json/Test/System.Json/JsonValueTest.cs
index 2459c1fc3ad..c3347c689d9 100644
--- a/mcs/class/System.Json/Test/System.Json/JsonValueTest.cs
+++ b/mcs/class/System.Json/Test/System.Json/JsonValueTest.cs
@@ -35,5 +35,11 @@ namespace MonoTests.System
var str = j.ToString ();
Assert.AreEqual (str, "[1, 2, 3, null]");
}
+
+ [Test]
+ public void QuoteEscapeBug_20869 ()
+ {
+ Assert.AreEqual ((new JsonPrimitive ("\"\"")).ToString (), "\"\\\"\\\"\"");
+ }
}
}