(set_option, delete_option): Gripe about unknown options. If multiple
options have identical names in Options[], all but the first are ignored. This should never happen.
This commit is contained in:
parent
4caf8bb440
commit
71411189b4
1 changed files with 8 additions and 2 deletions
|
@ -580,9 +580,12 @@ set_option(const char *s)
|
|||
struct option_list *op;
|
||||
|
||||
for (op = Options; op->opt_key; op++) {
|
||||
if (strcmp(op->opt_key, s) == 0)
|
||||
if (strcmp(op->opt_key, s) == 0) {
|
||||
*op->opt_valuep = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "Unknown option %s\n", s);
|
||||
}
|
||||
|
||||
/* delete an option from the list */
|
||||
|
@ -592,9 +595,12 @@ delete_option(const char *s)
|
|||
struct option_list *op;
|
||||
|
||||
for (op = Options; op->opt_key; op++) {
|
||||
if (strcmp(op->opt_key, s) == 0)
|
||||
if (strcmp(op->opt_key, s) == 0) {
|
||||
*op->opt_valuep = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "Unknown option %s\n", s);
|
||||
}
|
||||
|
||||
/* config interface */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue