Fixed -A_ parging from configuration files

This commit is contained in:
Luca Deri 2020-06-07 12:54:15 +02:00
parent f9f941c50b
commit c2626bae7c

20
edge.c
View File

@ -622,9 +622,25 @@ static int loadFromFile(const char *path, n2n_edge_conf_t *conf, n2n_priv_config
opt++;
}
} else if(line[0] == '-') { /* short opt */
char *equal;
key = &line[1], line_len--;
if(line_len > 1) key[1] = '\0';
if(line_len > 2) value = trim(&key[2]);
equal = strchr(line, '=');
if(equal) {
equal[0] = '\0';
/* Adding an exception for -A_ */
if(key[0] == 'A') {
value = &key[1];
key = "A";
} else {
value = &equal[1];
}
} else
value = "";
// traceEvent(TRACE_NORMAL, "key: %c value: %s", key[0], value);
setOption(key[0], value, ec, conf);