Re: [PATCH v2 2/2] list-objects-filter-options: avoid strbuf_split_str()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 11, 2026, 18:07 UTC
- Message-ID
- <xmqqo6kup7cw.fsf@gitster.g>
- In-Reply-To
- <20260311174548.GA1900488@coredump.intra.peff.net>
Jeff King <peff@peff.net> 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.
Show 7 quoted lines
> 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.