From: Junio C Hamano Date: Sun, 20 Aug 2006 22:57:11 GMT Subject: Re: [PATCH] Helper function to shell quote all arg values at once. Message-ID: <7vsljrxbg8.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20060820080749.e31276dd.chriscool@tuxfamily.org> Christian Couder writes: > The new sq_quote_argv function is used to refactor the > tracing code in "git.c" and "exec_cmd.c". > This function allocates memory and fills it with a string > containing the quoted argument values. Then it returns a > pointer to this memory that must be freed afterwards. Sorry, I do not see a point in this. If your original were doing malloc-print-free per iteration, then perhaps it makes sense to first format all into one allocated buffer, print all, and then free at once, like this patch does. But that was not what the original had. If the new function were to get a (const char **) array and FILE *, and print them, quoted and separated with spaces, then it would have shortened what two call sites did, which would have been an improvement. But that is not what this patch does, either.