mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-17 17:06:10 +00:00
Allow specifying address in configuration file
This commit is contained in:
parent
169e5da06f
commit
db3173bd80
10
src/config.c
10
src/config.c
@ -193,9 +193,13 @@ void config_file_parse(char* filename, PCONFIGURATION config) {
|
||||
while (getline(&line, &len, fd) != -1) {
|
||||
char *key = NULL, *value = NULL;
|
||||
if (sscanf(line, "%ms = %ms", &key, &value) == 2) {
|
||||
for (int i=0;long_options[i].name != NULL;i++) {
|
||||
if (long_options[i].has_arg = required_argument && strcmp(long_options[i].name, key) == 0) {
|
||||
parse_argument(long_options[i].val, value, config);
|
||||
if (strcmp(key, "address") == 0) {
|
||||
config->address = value;
|
||||
} else {
|
||||
for (int i=0;long_options[i].name != NULL;i++) {
|
||||
if (long_options[i].has_arg = required_argument && strcmp(long_options[i].name, key) == 0) {
|
||||
parse_argument(long_options[i].val, value, config);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user