path: root/string-list.h
diff options
authorMichael Haggerty <>2012-11-04 07:07:06 (GMT)
committerJeff King <>2012-11-08 16:34:08 (GMT)
commit6bb2a1377b4b7a044f69d0107c38479180694fac (patch)
tree3bf597a5322507120597b9ec67bcc2ee394a1530 /string-list.h
parent9c50374497d5a3259907e32455f228cfbda85ddf (diff)
string_list: add a function string_list_remove_empty_items()
Signed-off-by: Michael Haggerty <> Acked-by: Johan Herland <> Signed-off-by: Jeff King <>
Diffstat (limited to 'string-list.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/string-list.h b/string-list.h
index 5efd07b..c50b0d0 100644
--- a/string-list.h
+++ b/string-list.h
@@ -39,6 +39,13 @@ void filter_string_list(struct string_list *list, int free_util,
string_list_each_func_t want, void *cb_data);
+ * Remove any empty strings from the list. If free_util is true, call
+ * free() on the util members of any items that have to be deleted.
+ * Preserve the order of the items that are retained.
+ */
+void string_list_remove_empty_items(struct string_list *list, int free_util);
* Return the longest string in prefixes that is a prefix (in the
* sense of prefixcmp()) of string, or NULL if no such prefix exists.
* This function does not require the string_list to be sorted (it