]> granicus.if.org Git - neomutt/commitdiff
rename/move function
authorRichard Russon <rich@flatcap.org>
Thu, 3 Oct 2019 23:00:38 +0000 (00:00 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 8 Oct 2019 22:45:05 +0000 (23:45 +0100)
color.c

diff --git a/color.c b/color.c
index 8f4a8e01dd2e9c1dcd26beee07c83372b9ee4cce..a4f4a99772bc51519e192b56190eaa6202ae9f96 100644 (file)
--- a/color.c
+++ b/color.c
@@ -223,6 +223,20 @@ static void color_line_free(struct ColorLine **ptr, bool free_colors)
   FREE(ptr);
 }
 
+/**
+ * color_line_list_clear - Clear a list of colours
+ * @param list ColorLine List
+ */
+static void color_line_list_clear(struct ColorLineList *list)
+{
+  struct ColorLine *np = NULL, *tmp = NULL;
+  STAILQ_FOREACH_SAFE(np, list, entries, tmp)
+  {
+    STAILQ_REMOVE(list, np, ColorLine, entries);
+    color_line_free(&np, true);
+  }
+}
+
 /**
  * mutt_color_init - Set up the default colours
  */
@@ -1237,34 +1251,20 @@ enum CommandResult mutt_parse_mono(struct Buffer *buf, struct Buffer *s,
   return parse_color(buf, s, err, parse_attr_spec, dry_run, false);
 }
 
-/**
- * mutt_color_list_free - Free a list of colours
- * @param list ColorLine List
- */
-static void mutt_color_list_free(struct ColorLineList *list)
-{
-  struct ColorLine *np = NULL, *tmp = NULL;
-  STAILQ_FOREACH_SAFE(np, list, entries, tmp)
-  {
-    STAILQ_REMOVE(list, np, ColorLine, entries);
-    color_line_free(&np, true);
-  }
-}
-
 /**
  * mutt_colors_free - Free all the colours (on shutdown)
  */
 void mutt_colors_free(void)
 {
-  mutt_color_list_free(&ColorAttachList);
-  mutt_color_list_free(&ColorBodyList);
-  mutt_color_list_free(&ColorHdrList);
-  mutt_color_list_free(&ColorIndexAuthorList);
-  mutt_color_list_free(&ColorIndexFlagsList);
-  mutt_color_list_free(&ColorIndexList);
-  mutt_color_list_free(&ColorIndexSubjectList);
-  mutt_color_list_free(&ColorIndexTagList);
-  mutt_color_list_free(&ColorStatusList);
+  color_line_list_clear(&ColorAttachList);
+  color_line_list_clear(&ColorBodyList);
+  color_line_list_clear(&ColorHdrList);
+  color_line_list_clear(&ColorIndexAuthorList);
+  color_line_list_clear(&ColorIndexFlagsList);
+  color_line_list_clear(&ColorIndexList);
+  color_line_list_clear(&ColorIndexSubjectList);
+  color_line_list_clear(&ColorIndexTagList);
+  color_line_list_clear(&ColorStatusList);
 
   struct ColorList *cl = ColorList;
   struct ColorList *next = NULL;