Re: [PATCH v3 2/4] quote: add quote_path() flag to ignore config
On Sat, Feb 1, 2025 at 9:20 PM Justin Tobler <jltobler@gmail.com> wrote:
Show 7 quoted lines
> @@ -370,10 +370,18 @@ char *quote_path(const char *in, const char *prefix, struct strbuf *out, unsigne
> {
> struct strbuf sb = STRBUF_INIT;
> const char *rel = relative_path(in, prefix, &sb);
> - int force_dq = ((flags & QUOTE_PATH_QUOTE_SP) && strchr(rel, ' '));
> + unsigned cquote_flags = 0;
> + int force_dq = 0;I don't think you needed to change how force_dq was computed.
Show 6 quoted lines
> strbuf_reset(out);
>
> + if ((flags & QUOTE_PATH_QUOTE_SP) && strchr(rel, ' ')) {
> + force_dq = 1;
> + cquote_flags &= CQUOTE_NODQ;
> + }If you didn't change how force_dq was computed above, then this could be just:
if (force_dq)
cquote_flags &= CQUOTE_NODQ;> /* quote path as relative to the given prefix */
> char *quote_path(const char *in, const char *prefix, struct strbuf *out, unsigned flags);
> -#define QUOTE_PATH_QUOTE_SP 01
> +#define QUOTE_PATH_QUOTE_SP (1u << 0)
Nice cleanup that could be mentioned in the commit message if you reroll.
> +#define QUOTE_PATH_IGNORE_CONFIG (1u << 1)