mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 03:24:54 +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:
|
||||
return []
|
||||
|
||||
quoted = False
|
||||
for index, c in enumerate(s[offset:]):
|
||||
if c == "{":
|
||||
if c == '"':
|
||||
quoted = not quoted
|
||||
elif quoted:
|
||||
continue
|
||||
elif c == "{":
|
||||
opens += 1
|
||||
elif c == "}":
|
||||
opens -= 1
|
||||
|
|
Loading…
Add table
Reference in a new issue