Re: [PATCH 7/7] run_hook: use argv_array API
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 14, 2011, 18:54 UTC
- Message-ID
- <7vty8ft0oc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110913215824.GG24490@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> @@ -609,26 +610,23 @@ int finish_async(struct async *async)
> int run_hook(const char *index_file, const char *name, ...)
> {
> struct child_process hook;
> - const char **argv = NULL, *env[2];
> + struct argv_array argv = ARGV_ARRAY_INIT;
> + const char *p, *env[2];Given that in argv-array.h you define it as
#define ARGV_ARRAY_INIT { empty_argv, 0, 0 };the above will introduce decl-after-stmt.