tail is always a list_item**.
[apps/madmutt.git] / nntp / nntp.c
index 7409044..b39e67a 100644 (file)
@@ -1240,8 +1240,7 @@ int nntp_check_newgroups (NNTP_SERVER * serv, int force)
 {
   char buf[LONG_STRING];
   NNTP_DATA nntp_data;
-  string_list_t *l;
-  string_list_t emp;
+  string_list_t *l, **emp;
   time_t now;
   struct tm *t;
 
@@ -1278,7 +1277,8 @@ int nntp_check_newgroups (NNTP_SERVER * serv, int force)
     nntp_data.group = ((NNTP_DATA *) Context->data)->group;
   else
     nntp_data.group = NULL;
-  l = serv->tail;
+
+  emp = serv->tail;
   if (mutt_nntp_fetch (&nntp_data, buf, _("Adding new newsgroups..."), NULL,
                        add_group, serv, 0) != 0) {
     return -1;
@@ -1286,20 +1286,14 @@ int nntp_check_newgroups (NNTP_SERVER * serv, int force)
 
   mutt_message _("Loading descriptions...");
 
-  if (l)
-    emp.next = l->next;
-  else
-    emp.next = serv->list;
-  l = &emp;
-  while (l->next) {
-    l = l->next;
-    ((NNTP_DATA *) l->data)->new = 1;
-    nntp_get_desc ((NNTP_DATA *) l->data, ((NNTP_DATA *) l->data)->group,
-                   NULL, NULL);
+  for (l = *emp; l; l = l->next) {
+    ((NNTP_DATA *)l->data)->new = 1;
+    nntp_get_desc((NNTP_DATA *) l->data, ((NNTP_DATA *)l->data)->group,
+                  NULL, NULL);
   }
-  if (emp.next)
-    nntp_save_cache_index (serv);
-  mutt_clear_error ();
+  if (*emp)
+    nntp_save_cache_index(serv);
+  mutt_clear_error();
   return _checked;
 }