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.
pull/1/head
Syrone Wong 3 years ago committed by GitHub
parent af875d2ad0
commit 0993b354e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save