diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-01-10 10:35:48 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-01-10 10:35:48 +0000 |
commit | 544e8ba393e9c1ca55b120f209383742211007c8 (patch) | |
tree | 5157baa0f2071aa0763254491475416832cdf991 /edit.c | |
parent | c8e19c984e900ede0f0c09353a96c62a6aa81445 (diff) |
Add (and use) a function mutt_str_replace, which essentially
replaces the sequence:
safe_free (&s);
s = safe_strdup (t);
Diffstat (limited to 'edit.c')
-rw-r--r-- | edit.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -253,10 +253,7 @@ static void be_edit_header (ENVELOPE *e, int force) addstr ("Subject: "); strfcpy (tmp, e->subject ? e->subject: "", sizeof (tmp)); if (mutt_enter_string ((unsigned char *) tmp, sizeof (tmp), LINES-1, 9, 0) == 0) - { - safe_free ((void **) &e->subject); - e->subject = safe_strdup (tmp); - } + mutt_str_replace (&e->subject, tmp); addch ('\n'); } @@ -391,8 +388,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) addstr (_("missing filename.\n")); break; case 's': - safe_free ((void **) &msg->env->subject); - msg->env->subject = safe_strdup (p); + mutt_str_replace (&msg->env->subject, p); break; case 't': msg->env->to = rfc822_parse_adrlist (msg->env->to, p); |