Subject: Re: [PATCH v2 2/2] list-objects-filter-options: avoid strbuf_split_str()

From: Junio C Hamano <[email-masked]>
Date: Wed, 11 Mar 2026 11:07:59 -0700

Jeff King <[email-masked]> writes:

> I don't think this is quite right. After we skip the first "+" and "p"
> points to the second one, then strchrnul() will find that second "+",
> not NUL. And so we have a 0-length spec, and feed the empty string to
> parse_combine_subfilter(), which complains.

Ah, I misread gently_parse_list_objects_fiter(), which makes a NULL
arg a silent no-op, but fully complains on an empty string.  Thanks.

> But yeah, it is somewhat inconsistent that we complain about an empty
> spec in the middle, but not at the end. If we were starting from
> scratch, I'd probably forbid it everywhere. But since we allow it in
> some cases now, it may be worth being more permissive.
>
> It is easy to check in the loop, or even just teach the helper to make
> empty specs a noop:

Yup.