Re: [PATCH] git grep: Add "-Z/--null" option as in GNU's grep.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 1, 2008, 15:03 UTC
- Message-ID
- <20081001150308.GZ21310@spearce.org>
- In-Reply-To
- <20081001061249.GC22363@artemis.corp>
Pierre Habouzit <madcoder@debian.org> wrote:
Show 7 quoted lines
> On Tue, Sep 30, 2008 at 11:13:10PM +0000, Raphael Zimmerer wrote:
> > + printf("%s%c", name, opt->null_following_name ? 0 : '\n');
>
> I know I'm nitpicking and I don't know what the git custom on this
> really is, but I tend to prefer '\0' when in the context of a char.
> There is no confusion here of course, but I believe it to be a sane
> habit. (In the same vein that it's ugly to use 0 for NULL ;p).Its a valid nitpick. NUL is '\0' when dealing with chars in Git, NULL is NULL, and 0 is the integer 0. That line should read '\0' to conform with the other code already in git.git.
-- Shawn.