diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2001-05-11 11:10:43 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2001-05-11 11:10:43 +0000 |
commit | 1d317f6240cf57f34f7dbb15619e207679e3ba96 (patch) | |
tree | accfda9eb2f574008608e1d1a07b33037b5355c2 | |
parent | 0a41d00b51975a276b4c35cebe4d4e6e0d837d5a (diff) |
Some code simplifications.
-rw-r--r-- | headers.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -40,7 +40,7 @@ void mutt_edit_headers (const char *editor, ENVELOPE *n; time_t mtime; struct stat st; - LIST *cur, *last = NULL, *tmp; + LIST *cur, **last = NULL, *tmp; mutt_mktemp (path); if ((ofp = safe_fopen (path, "w")) == NULL) @@ -123,6 +123,7 @@ void mutt_edit_headers (const char *editor, */ cur = msg->env->userhdrs; + last = &msg->env->userhdrs; while (cur) { keep = 1; @@ -188,17 +189,14 @@ void mutt_edit_headers (const char *editor, if (keep) { - last = cur; - cur = cur->next; + last = &cur->next; + cur = cur->next; } else { - if (last) - last->next = cur->next; - else - msg->env->userhdrs = cur->next; - tmp = cur; - cur = cur->next; + tmp = cur; + *last = cur->next; + cur = cur->next; tmp->next = NULL; mutt_free_list (&tmp); } |