mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05: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;
|
const char *p;
|
||||||
if (!spa_json_is_string(val, len)) {
|
if (!spa_json_is_string(val, len)) {
|
||||||
bool skip = false, comment = false;
|
strncpy(result, val, len);
|
||||||
for (p = val; p < val + len; p++) {
|
result += len;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for (p = val+1; p < val + len; p++) {
|
for (p = val+1; p < val + len; p++) {
|
||||||
if (*p == '\\') {
|
if (*p == '\\') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue