diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-06 13:25:25 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-06 13:25:25 -0400 |
commit | 39a9e3942cef811f52993c702f1f69b1d28fc7cd (patch) | |
tree | fa5a0d21be7977e1026c92e2a4691d2ae2752551 /config.c | |
parent | 20d1b2259937dc8cd6e3729a9795809c176ef2a6 (diff) |
Added a loop for finding a valid config option.
I also added a call to a function that parses the
value of the config option.
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -98,5 +98,14 @@ config *parse_config(const char *filename) { char *line = get_line(&buf); char *value; char *name = strtok_r(line, "=", &value); + const config_opt *opt; + + /* Check to see if the config option name we got is valid. */ + for (opt = config_opts; opt->name != NULL && strcmp(name, opt->name); opt++); + + /* Is the config option valid? */ + if (opt->name != NULL) { + config_val val = parse_option_value(opt, value); + } } } |