Thread (1 message) 1 message, 1 author, 2025-08-01

Re: [PATCH v2 6/7] string-list: optionally omit empty string pieces in string_list_split*()

From: Junio C Hamano <hidden>
Date: 2025-08-01 16:38:20

Patrick Steinhardt [off-list ref] writes:
quoted
+	if ((flags & STRING_LIST_SPLIT_NONEMPTY) && (end <= p))
+		return 0;
Okay, this is where the return value of `append_one()` starts to make
sense.

The condition for `end <= p` is probably overly defensive, as it
shouldn't ever happen that `end < p`. We could make that a `BUG()`, but
I'm not sure that's really worth it.
Correct.  I'd leave it to be defensive but without overly
pessimistic BUG, as this is a leaf function that, once carefully
vetted, is unlikely to become buggy (which is famous last words).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help