Re: [PATCH] builtin-grep: workaround for non GNU grep.
- From
- Bertrand Jacquin <beber.mailing@gmail.com>
- Date
- May 17, 2006, 15:39 UTC
- Message-ID
- <4fb292fa0605170839r259732dcw1c1bae3f1808db32@mail.gmail.com>
- In-Reply-To
- <7vves5geng.fsf_-_@assigned-by-dhcp.cox.net>
On 5/17/06, Junio C Hamano <junkio@cox.net> wrote:
Show 5 quoted lines
> +ifdef NO_H_OPTION_IN_GREP > + NO_H_OPTION_IN_GREP=1 > +else > + NO_H_OPTION_IN_GREP=0 > +endif
Show 6 quoted lines
> + if (NO_H_OPTION_IN_GREP)
> + push_arg("/dev/null");
> + else {
> + push_arg("-H");
> + push_arg("--");
> + }Sorry, maybe a C code beginner question but while you define NO_H_OPTION_IN_GREP in Makefile, why don't use a build time ``if'' instead of a runtime one ?
Like :
#if NO_H_OPTION_IN_GREP
push_arg("/dev/null");
#else
push_arg("-H");
push_arg("--");
#fi-- Beber #e.fr@freenode