Jonathan Nieder <jrnieder@xxxxxxxxx> writes: > Matthieu Moy wrote: > >> +++ b/diff.c >> @@ -2990,9 +2990,23 @@ static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *va > [...] >> +#define IF_SHORT_OPT(optname) \ >> + ((!strcmp(arg, "-" #optname) \ >> + && (argv[1] || (die("Option `" #optname "' requires a value"), 1), \ >> + optarg = argv[1], \ >> + argcount = 2, \ >> + 1)) || \ >> + (!prefixcmp(arg, "-" #optname) \ >> + && (optarg = arg + strlen("-" #optname), \ >> + argcount = 1, \ >> + 1))) >> + > > Why not something like this? > > static inline int short_opt(char opt, const char *arg, > const char *argv, const char **optarg) Sounds nice too. I'll do that in the next round. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html