Re: [PATCH v3 5/7] quote: add sq_append_quote_argv_pretty()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 9, 2019, 17:54 UTC
- Message-ID
- <xmqqtvaqcjhx.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <2002108a30246824f8017da1dea344c1a96f7de2.1565362851.git.gitgitgadget@gmail.com>
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> +/*
> + * Legacy function to append each argv value, quoted as necessasry,
> + * with whitespace before each value. This results in a leading
> + * space in the result.
> + */
> void sq_quote_argv_pretty(struct strbuf *dst, const char **argv)
> +{
> + if (argv[0])
> + strbuf_addch(dst, ' ');
> + sq_append_quote_argv_pretty(dst, argv);Micronit (not worth a reroll): if !argv[0], there is no need to call append, either.