conf: trim prefix space for multiline option

This commit is contained in:
Nick Peng
2023-06-15 21:18:08 +08:00
parent 08567c458b
commit a6e5ceb675
3 changed files with 47 additions and 5 deletions

View File

@@ -1527,7 +1527,7 @@ static int _conf_domain_rule_address(char *domain, const char *domain_address)
field = ptr;
ptr = strstr(ptr, ",");
if (field == NULL) {
if (field == NULL || *field == '\0') {
break;
}
@@ -1657,7 +1657,8 @@ errout:
_dns_rule_put(address);
}
tlog(TLOG_ERROR, "add address %s, %s failed", domain, domain_address);
tlog(TLOG_ERROR, "add address %s, %s at %s:%d failed", domain, domain_address, conf_get_conf_file(),
conf_get_current_lineno());
return 0;
}