mirror of
https://gitee.com/ja-netfilter/ja-netfilter
synced 2026-06-20 16:45:36 +08:00
ConfigParser: do NOT override existing sections
This commit support format as below: ``` [DNS] EQUAL,example.com [URL] PREFIX,https://example.com/a [URL] PREFIX,https://example.com/foo [URL] PREFIX,https://example.com/bar ``` It merges sections with the same section name.
This commit is contained in:
parent
af875d2ad0
commit
0993b354e5
1 changed files with 4 additions and 1 deletions
|
|
@ -45,7 +45,10 @@ public class ConfigParser {
|
|||
}
|
||||
|
||||
lastSection = section;
|
||||
map.put(lastSection, new ArrayList<>());
|
||||
if (null == map.get(lastSection)) {
|
||||
// do NOT override existing sections
|
||||
map.put(lastSection, new ArrayList<>());
|
||||
}
|
||||
break;
|
||||
case '#':
|
||||
case ';':
|
||||
|
|
|
|||
Loading…
Reference in a new issue