Browse Source

Fixed -A_ parging from configuration files

pull/253/head
Luca Deri 4 years ago
parent
commit
c2626bae7c
  1. 20
      edge.c

20
edge.c

@ -622,9 +622,25 @@ static int loadFromFile(const char *path, n2n_edge_conf_t *conf, n2n_priv_config
opt++; opt++;
} }
} else if(line[0] == '-') { /* short opt */ } else if(line[0] == '-') { /* short opt */
char *equal;
key = &line[1], line_len--; 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); // traceEvent(TRACE_NORMAL, "key: %c value: %s", key[0], value);
setOption(key[0], value, ec, conf); setOption(key[0], value, ec, conf);

Loading…
Cancel
Save