From: Jeff King Date: Wed, 18 Apr 2012 21:07:40 GMT Subject: Re: [PATCH] gc: fix off-by-one in append_option Message-ID: <20120418210740.GA21214@sigill.intra.peff.net> In-Reply-To: <20120418202116.GA12964@sigill.intra.peff.net> On Wed, Apr 18, 2012 at 01:21:16PM -0700, Jeff King wrote: > > I am perfectly OK with even without initializers, like this: > > > > struct argv_array repack = ARGV_ARRAY_INIT; > > argv_array_push_strings(&repack, "repack", "-d", "-l", NULL); > > I think that is sane, and certainly the simplest. I'll send a patch in a > moment. Here it is. This goes directly on top of 7e52f56 (the tip of jk/repack-no-explode-objects-from-old-pack). The off-by-one fix I sent earlier can be dropped, as that code is removed by the final patch below. [1/3]: argv-array: refactor empty_argv initialization [2/3]: argv-array: add a new "pushl" method [3/3]: gc: use argv-array for sub-commands -Peff