From 8c1562a8e8eb322947e33c88ff6ccbee6e77a9f0 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sat, 16 Jun 2012 20:27:53 +0100 Subject: [PATCH] Temporary hack to get htsmsg_json to accept (though ignore) escaped hex. --- src/htsmsg_json.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/htsmsg_json.c b/src/htsmsg_json.c index a302247d..89f78f6c 100644 --- a/src/htsmsg_json.c +++ b/src/htsmsg_json.c @@ -164,7 +164,7 @@ htsmsg_json_parse_string(const char *s, const char **endp) if(*s == '\\') { esc = 1; - } else if(*s == '"' && s[-1] != '\\') { + } else if(*s == '"' && (s[-1] != '\\' || s[-2] == '\\')) { *endp = s + 1; @@ -184,6 +184,8 @@ htsmsg_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') @@ -193,9 +195,12 @@ htsmsg_json_parse_string(const char *s, const char **endp) else if(*a == 't') *b++ = '\t'; else if(*a == 'u') { +#if TODO /* 4 hexdigits: Not supported */ free(r); return NULL; +#endif + a += 4; } else { *b++ = *a; }