report conflicting options
This commit is contained in:
parent
c79315a213
commit
e69985db3b
1 changed files with 12 additions and 0 deletions
|
|
@ -226,5 +226,17 @@ void parse_one_option(struct cfginfo *restrict tmpcfg, const char *str, const ch
|
|||
}
|
||||
|
||||
unsigned offset = uintptr &~ FLAGMASK;
|
||||
|
||||
char *dupecheck;
|
||||
memcpy(&dupecheck, offset+(char*)tmpcfg, sizeof(char*));
|
||||
if(dupecheck)
|
||||
{
|
||||
if(src)
|
||||
printf("Option '%s' in config file '%s' sets '%s' again.\n",str,src,cfg->name);
|
||||
else
|
||||
printf("Command line option '--%s' sets '%s' again.\n",str,cfg->name);
|
||||
exit(53);
|
||||
}
|
||||
|
||||
memcpy(offset+(char*)tmpcfg, &opt, sizeof(char*));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue