mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
json: revert strippinf code, this needs more work
This commit is contained in:
parent
b61c4a88c4
commit
febe8054e4
1 changed files with 2 additions and 26 deletions
|
|
@ -287,32 +287,8 @@ static inline int spa_json_parse_string(const char *val, int len, char *result)
|
|||
{
|
||||
const char *p;
|
||||
if (!spa_json_is_string(val, len)) {
|
||||
bool skip = false, comment = false;
|
||||
for (p = val; p < val + len; p++) {
|
||||
switch (*p) {
|
||||
case '#':
|
||||
comment = true;
|
||||
break;
|
||||
case '\n': case '\r':
|
||||
comment = false;
|
||||
break;
|
||||
case '\b': case '\t': case '\f':
|
||||
break;
|
||||
case ' ':
|
||||
if (!comment) {
|
||||
if (!skip)
|
||||
*result++ = *p;
|
||||
skip = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!comment) {
|
||||
*result++ = *p;
|
||||
skip = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
strncpy(result, val, len);
|
||||
result += len;
|
||||
} else {
|
||||
for (p = val+1; p < val + len; p++) {
|
||||
if (*p == '\\') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue