mirror of
https://gitee.com/ja-netfilter/ja-netfilter.git
synced 2024-11-16 23:49:38 +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
@ -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 New Issue
Block a user