diff --git a/src/config/opttypes.c b/src/config/opttypes.c index ff486027f..3c86a9665 100644 --- a/src/config/opttypes.c +++ b/src/config/opttypes.c @@ -90,19 +90,6 @@ exec_cmd(struct option *o, unsigned char ***argv, int *argc) * possibly changing ptr to structure containing target name and pointer to * options list? --pasky */ -#define wrap_or_(name_, call_, ret_) \ -{ \ - struct option *real = get_opt_rec(config_options, opt->value.string); \ - \ - assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); \ - if_assert_failed { return ret_; } \ - \ - if (option_types[real->type].name_) \ - return option_types[real->type].call_; \ - \ - return ret_; \ -} - static unsigned char * redir_cmd(struct option *opt, unsigned char ***argv, int *argc) { @@ -124,7 +111,22 @@ redir_cmd(struct option *opt, unsigned char ***argv, int *argc) static unsigned char * redir_rd(struct option *opt, unsigned char **file, int *line) - wrap_or_(read, read(real, file, line), NULL); +{ + struct option *real = get_opt_rec(config_options, opt->value.string); + unsigned char *ret = NULL; + + assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); + if_assert_failed { return ret; } + + if (option_types[real->type].read) { + ret = option_types[real->type].read(real, file, line); + if (ret && (opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) { + *(long *) ret = !*(long *) ret; + } + } + + return ret; +} static void redir_wr(struct option *opt, struct string *string)