aboutsummaryrefslogtreecommitdiffstats
path: root/string-list.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-01 15:04:22 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-02 22:34:45 -0700
commit27531efa41cfa882473513dd93e696a16f6eb87b (patch)
tree262567942f856b61a9a7f29ef210dc526c0b5293 /string-list.h
parentf3a303aef017ad6e53fa44643d832a1fa0de0d91 (diff)
downloadgit-27531efa41cfa882473513dd93e696a16f6eb87b.tar.gz
string-list: optionally omit empty string pieces in string_list_split*()
Teach the unified split_string() machinery a new flag bit, STRING_LIST_SPLIT_NONEMPTY, to cause empty split pieces to be omitted from the resulting string list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.h')
-rw-r--r--string-list.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/string-list.h b/string-list.h
index 40e148712d..2b438c7733 100644
--- a/string-list.h
+++ b/string-list.h
@@ -289,6 +289,8 @@ enum {
* it to the list
*/
STRING_LIST_SPLIT_TRIM = (1 << 0),
+ /* omit adding empty string piece to the resulting list */
+ STRING_LIST_SPLIT_NONEMPTY = (1 << 1),
};
int string_list_split_f(struct string_list *, const char *string,