return true;
}
+/**
+ * mutt_str_remall_strcasestr - Remove all occurrences of substring, ignoring case
+ * @param str String containing the substring
+ * @param target Target substring for removal
+ * @retval 0 String contained substring and substring was removed successfully
+ * @retval 1 String did not contain substring
+ */
+int mutt_str_remall_strcasestr(char *str, const char *target)
+{
+ int retval = 1;
+
+ // Look through an ensure all instances of the substring are gone.
+ while ((str = (char *) mutt_str_strcasestr(str, target)))
+ {
+ size_t target_len = mutt_str_strlen(target);
+ memmove(str, str + target_len, 1 + strlen(str + target_len));
+ retval = 0; // If we got here, then a substring existed and has been removed.
+ }
+
+ return retval;
+}
+
/**
* mutt_str_strcasestr - Find a substring within a string without worrying about case
* @param haystack String that may or may not contain the substring
size_t mutt_str_lws_rlen(const char *s, size_t n);
const char *mutt_str_next_word(const char *s);
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num);
+int mutt_str_remall_strcasestr(char *str, const char *target);
void mutt_str_remove_trailing_ws(char *s);
void mutt_str_replace(char **p, const char *s);
const char *mutt_str_rstrnstr(const char *haystack, size_t haystack_length, const char *needle);