- /* loop over list while it's sorted */
- tmp1 = NULL;
- last = NULL;
- for (tmp = &Incoming; *tmp ; tmp = &((*tmp)->next)) {
- /*
- * FIXME
- * change this to get whatever sorting order
- */
- if (mutt_strcmp (buf, (*tmp)->path) < 0) {
- tmp1 = (*tmp);
- break;
- }
- last = (*tmp);
- }
-
- /* we want: last -> tmp -> tmp1 */
- *tmp = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
- (*tmp)->path = safe_strdup (buf);
- (*tmp)->magic = 0;
+ if (!*tmp) {
+ *tmp = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
+ (*tmp)->path = safe_strdup (buf);
+ (*tmp)->next = NULL;
+ /* it is tempting to set magic right here */
+ (*tmp)->magic = 0;