mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[#3079] Fix config parsing for json objects
* If a curly brace was used in a string then find_json_ojects would fail to find objects correctly. To fix this ignore double-quoted entries.
This commit is contained in:
parent
65fac156eb
commit
6d14be18b0
1 changed files with 6 additions and 1 deletions
|
@ -111,8 +111,13 @@ def find_json_objects(s):
|
||||||
if start < 0:
|
if start < 0:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
quoted = False
|
||||||
for index, c in enumerate(s[offset:]):
|
for index, c in enumerate(s[offset:]):
|
||||||
if c == "{":
|
if c == '"':
|
||||||
|
quoted = not quoted
|
||||||
|
elif quoted:
|
||||||
|
continue
|
||||||
|
elif c == "{":
|
||||||
opens += 1
|
opens += 1
|
||||||
elif c == "}":
|
elif c == "}":
|
||||||
opens -= 1
|
opens -= 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue