From: Adam Sutton Date: Wed, 21 Nov 2012 21:34:31 +0000 (+0000) Subject: Re-apply previous fix to JSON escape processing required by opentv config files. X-Git-Tag: v3.5~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=459bf3fd50604206806b63c0ab3d26c35fad28bd;p=thirdparty%2Ftvheadend.git Re-apply previous fix to JSON escape processing required by opentv config files. --- diff --git a/src/misc/json.c b/src/misc/json.c index 59f40ebb6..08f8a74da 100644 --- a/src/misc/json.c +++ b/src/misc/json.c @@ -62,7 +62,11 @@ json_parse_string(const char *s, const char **endp, if(*s == '\\') { esc = 1; - } else if(*s == '"' && s[-1] != '\\') { + /* skip the escape */ + s++; + if (*s == 'u') s += 4; + // Note: we could detect the lack of support here! + } else if(*s == '"') { *endp = s + 1; @@ -82,6 +86,8 @@ json_parse_string(const char *s, const char **endp, a++; if(*a == 'b') *b++ = '\b'; + else if(*a == '\\') + *b++ = '\\'; else if(*a == 'f') *b++ = '\f'; else if(*a == 'n')