From: Thomas Roessler Date: Thu, 7 Jun 2001 08:50:58 +0000 (+0000) Subject: Don't add empty strings to lists. From Thomas Parmelan X-Git-Tag: mutt-1-3-19-rel~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec7c0d185c129da1f720f64f57c70f5cdeeb7fd6;p=mutt Don't add empty strings to lists. From Thomas Parmelan . --- diff --git a/init.c b/init.c index 81b494a0..3200851a 100644 --- 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) {