]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Re-apply previous fix to JSON escape processing required by opentv config files.
authorAdam Sutton <dev@adamsutton.me.uk>
Wed, 21 Nov 2012 21:34:31 +0000 (21:34 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Wed, 21 Nov 2012 21:34:31 +0000 (21:34 +0000)
src/misc/json.c

index 59f40ebb6f538fb541d2e2fb75336b84778a55aa..08f8a74da9e97a8482ec23fd279e1c7849e8143e 100644 (file)
@@ -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')