Subject: Re: [PATCH v4 3/7] reftable: check for trailing newline in 'tables.list'

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 2 Oct 2025 13:44:24 +0200

On Fri, Sep 26, 2025 at 09:25:46AM +0200, Karthik Nayak wrote:
> diff --git a/reftable/basics.c b/reftable/basics.c
> index 9988ebd635..e969927b61 100644
> --- a/reftable/basics.c
> +++ b/reftable/basics.c
> @@ -195,44 +195,55 @@ size_t names_length(const char **names)
>  	return p - names;
>  }
>  
> -char **parse_names(char *buf, int size)
> +int parse_names(char *buf, int size, char ***out)
>  {

Yup, this changed function signature reads a lot nicer to me now and is
more in line with our usual coding style.

> diff --git a/reftable/basics.h b/reftable/basics.h
> index 7d22f96261..693db9524f 100644
> --- a/reftable/basics.h
> +++ b/reftable/basics.h
> @@ -167,10 +167,9 @@ void free_names(char **a);
>  
>  /*
>   * Parse a newline separated list of names. `size` is the length of the buffer,
> - * without terminating '\0'. Empty names are discarded. Returns a `NULL`
> - * pointer when allocations fail.
> + * without terminating '\0'. Empty names are discarded.
>   */
> -char **parse_names(char *buf, int size);
> +int parse_names(char *buf, int size, char ***out);

Tiny nit, not worth a reroll: we may still want to document that a
return value of 0 means success, and that it otherwise returns a
reftable error code.

Patrick