Re: [PATCH v3 3/8] reftable: check for trailing newline in 'tables.list'
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Sep 24, 2025, 11:06 UTC
- Message-ID
- <CAOLa=ZSkx--7A6zs3RK3Noa=bBZ8mSLMVWBYr7tUFXQkrstgMw@mail.gmail.com>
- In-Reply-To
- <b6d03748-8171-4df3-83fd-7f4025d9eb6c@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 12 quoted lines
> On Thu, Sep 18, 2025, at 10:11, Karthik Nayak wrote: >> In the reftable format, the 'tables.list' file contains a newline >> separated list of tables. While we parse this file, we do not check or >> care about trailing newlines. Tighten the parser in `parse_names()` to >> return an appropriate error if there is no trailing newline. > > Nit:[1] newline-separated + requiring a trailing newline sounds like it > really equals: newline-terminated list. Is this moving from > effectively using newline-separated to a newline-terminated format? > > † 1: Since others have commented anyway >
I see the confusion, it is a newline-separated list, but we don't check/care for the last newline. We don't require a separate terminating newline. Let me amend the commit message to make this clearer.
Show 6 quoted lines
>> >> This requires modification to `parse_names()` to accept a third argument >> which will hold the error value. >> >> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> >> ---