Re: [PATCH v2 6/7] string-list: optionally omit empty string pieces in string_list_split*()
- From
shejialuo <shejialuo@gmail.com>
- Date
- Aug 1, 2025, 03:33 UTC
- Message-ID
- <aIw1niPrhuvt8QoQ@mbp>
- In-Reply-To
- <20250731224607.3942417-7-gitster@pobox.com>
On Thu, Jul 31, 2025 at 03:46:05PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> diff --git a/string-list.c b/string-list.c > index 86a309f8fb..343cf1ca90 100644 > --- a/string-list.c > +++ b/string-list.c > @@ -294,6 +294,9 @@ static int append_one(struct string_list *list, > break; > } > > + if ((flags & STRING_LIST_SPLIT_NONEMPTY) && (end <= p)) > + return 0; > +
I somehow think we should do this directly in `split_string` function. And should we use `end == p`?
Thanks, Jialuo