path: root/string-list.h
diff options
authorBrandon Williams <>2017-04-19 23:13:21 (GMT)
committerJunio C Hamano <>2017-04-21 00:55:32 (GMT)
commit3a30033327337323e91dcbcb87396d3245260585 (patch)
treee008f3df89e78774ab9810a3e18fe6b472049616 /string-list.h
parente3a434468fecca7c14a6bef32050dfa60534fde6 (diff)
string-list: add string_list_remove function
Teach string-list to be able to remove a string from a sorted 'struct string_list'. Signed-off-by: Brandon Williams <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'string-list.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/string-list.h b/string-list.h
index d3809a1..29bfb7a 100644
--- a/string-list.h
+++ b/string-list.h
@@ -63,6 +63,13 @@ int string_list_find_insert_index(const struct string_list *list, const char *st
struct string_list_item *string_list_insert(struct string_list *list, const char *string);
+ * Removes the given string from the sorted list.
+ * If the string doesn't exist, the list is not altered.
+ */
+extern void string_list_remove(struct string_list *list, const char *string,
+ int free_util);
* Checks if the given string is part of a sorted list. If it is part of the list,
* return the coresponding string_list_item, NULL otherwise.