From: Christian Couder Date: Sun, 02 Dec 2007 08:48:46 GMT Subject: Re: [PATCH 1/3] Prepare execv_git_cmd() for removal of builtins from the filesystem Message-ID: <200712020948.47084.chriscool@tuxfamily.org> In-Reply-To: <1196579005-5662-1-git-send-email-gitster@pobox.com> Le dimanche 2 décembre 2007, Junio C Hamano a écrit : > + for (argc = 0; argv[argc]; argc++) > + ; /* just counting */ > + nargv = xmalloc(sizeof(*nargv) * (argc + 2)); > > - trace_argv_printf(argv, -1, "trace: exec:"); > + nargv[0] = "git"; > + for (argc = 0; argv[argc]; argc++) > + nargv[argc + 1] = argv[argc]; > + nargv[argc + 1] = NULL; > + trace_argv_printf(nargv, -1, "trace: exec:"); Minor nit: now that the number of arguments is known, we could perhaps use the argument count instead of -1 in trace_argv_printf, so that it is not computed again in quote.c:sq_quote_argv, like this: trace_argv_printf(nargv, argc + 1, "trace: exec:"); Christian.