From: Bertrand Jacquin Date: Wed, 17 May 2006 15:39:26 GMT Subject: Re: [PATCH] builtin-grep: workaround for non GNU grep. Message-ID: <4fb292fa0605170839r259732dcw1c1bae3f1808db32@mail.gmail.com> In-Reply-To: <7vves5geng.fsf_-_@assigned-by-dhcp.cox.net> On 5/17/06, Junio C Hamano wrote: > +ifdef NO_H_OPTION_IN_GREP > + NO_H_OPTION_IN_GREP=1 > +else > + NO_H_OPTION_IN_GREP=0 > +endif > + 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