Re: [PATCH v3 2/4] quote: add quote_path() flag to ignore config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 1, 2025 at 9:20 PM Justin Tobler <jltobler@xxxxxxxxx> wrote:

> @@ -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.

>         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)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux