]> granicus.if.org Git - mutt/commitdiff
Don't add empty strings to lists. From Thomas Parmelan
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 7 Jun 2001 08:50:58 +0000 (08:50 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 7 Jun 2001 08:50:58 +0000 (08:50 +0000)
<tom@proxad.net>.

init.c

diff --git a/init.c b/init.c
index 81b494a0b17e5c7a7abab87e4ffbf96a78920dec..3200851aeae5c994d21e75a5a43d7c24e24fd749 100644 (file)
--- a/init.c
+++ b/init.c
@@ -308,6 +308,10 @@ static void add_to_list (LIST **list, const char *str)
 {
   LIST *t, *last = NULL;
 
+  /* don't add a NULL or empty string to the list */
+  if (!str || *str == '\0')
+    return;
+
   /* check to make sure the item is not already on this list */
   for (last = *list; last; last = last->next)
   {