Re: [PATCH v3 1/4] quote: add c quote flag to ignore core.quotePath

[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:


> -static inline int cq_must_quote(char c)
> +static inline int cq_must_quote(char c, int ignore_config)

I think it's a bit better to use 'unsigned int' instead of just 'int'
for such flags, but it's fine here to use an 'int' because both
`quote_path_fully` and `no_dq` below already use that type.

> -               for (len = 0; len < maxlen && !cq_must_quote(s[len]); len++);
> +               for (len = 0;
> +                    len < maxlen && !cq_must_quote(s[len], ignore_config); len++);

Micronit: If you really want to split the line into many lines, I
think it might be better to go all the way like this:

              for (len = 0;
                   len < maxlen && !cq_must_quote(s[len], ignore_config);
                   len++);

> @@ -83,7 +83,8 @@ int sq_dequote_to_strvec(char *arg, struct strvec *);
>  int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
>
>  /* Bits in the flags parameter to quote_c_style() */
> -#define CQUOTE_NODQ 01
> +#define CQUOTE_NODQ         (1u << 0)

Nice small cleanup which could be mentioned in the commit message if
you reroll this series.

> +#define CQUOTE_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