Re: [PATCH] builtin-grep: workaround for non GNU grep.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/17/06, Junio C Hamano <junkio@xxxxxxx> 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
-
: 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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]