git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] Prepare execv_git_cmd() for removal of builtins from the filesystem

From
Christian Couder <chriscool@tuxfamily.org>
Date
Dec 2, 2007, 08:48 UTC
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 :
Show 10 quoted lines
> +	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.
Previous: Johannes Schindelin
Message 5 of 5 in “Prepare execv_git_cmd() for removal of builtins from the filesystem”
  1. 1/3 Prepare execv_git_cmd() for removal of builtins from the filesystemJunio C Hamano, Dec 2, 2007
  2. 2/3 Avoid double exec() in execv_git_cmd()Junio C Hamano, Dec 2, 2007
  3. 3/3 git-shell: accept "git foo" formJunio C Hamano, Dec 2, 2007
  4. Johannes SchindelinDec 2, 2007
  5. Christian CouderDec 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.