From 5de64c134c980ffaf379b56108cd5a452dcce44a Mon Sep 17 00:00:00 2001 From: ari Date: Fri, 13 Jan 2017 16:47:48 -0500 Subject: [PATCH] bug 309 accept multi-line string values --- JSONTokener.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/JSONTokener.java b/JSONTokener.java index d0b197d73..fac73e9d4 100644 --- a/JSONTokener.java +++ b/JSONTokener.java @@ -264,8 +264,6 @@ public String nextString(char quote) throws JSONException { c = this.next(); switch (c) { case 0: - case '\n': - case '\r': throw this.syntaxError("Unterminated string"); case '\\': c = this.next(); @@ -324,7 +322,7 @@ public String nextTo(char delimiter) throws JSONException { StringBuilder sb = new StringBuilder(); for (;;) { char c = this.next(); - if (c == delimiter || c == 0 || c == '\n' || c == '\r') { + if (c == delimiter || c == 0) { if (c != 0) { this.back(); } @@ -348,8 +346,7 @@ public String nextTo(String delimiters) throws JSONException { StringBuilder sb = new StringBuilder(); for (;;) { c = this.next(); - if (delimiters.indexOf(c) >= 0 || c == 0 || - c == '\n' || c == '\r') { + if (delimiters.indexOf(c) >= 0 || c == 0) { if (c != 0) { this.back(); }