summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-01-10 10:35:48 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-01-10 10:35:48 +0000
commit544e8ba393e9c1ca55b120f209383742211007c8 (patch)
tree5157baa0f2071aa0763254491475416832cdf991 /init.c
parentc8e19c984e900ede0f0c09353a96c62a6aa81445 (diff)
Add (and use) a function mutt_str_replace, which essentially
replaces the sequence: safe_free (&s); s = safe_strdup (t);
Diffstat (limited to 'init.c')
-rw-r--r--init.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/init.c b/init.c
index c824c047..56e65105 100644
--- a/init.c
+++ b/init.c
@@ -653,20 +653,16 @@ static void mutt_restore_default (struct option_t *p)
{
case DT_STR:
if (p->init)
- {
- FREE (p->data);
- *((char **) p->data) = safe_strdup ((char *) p->init);
- }
+ mutt_str_replace ((char **) p->data, (char *) p->init);
break;
case DT_PATH:
if (p->init)
{
char path[_POSIX_PATH_MAX];
- FREE (p->data);
strfcpy (path, (char *) p->init, sizeof (path));
mutt_expand_path (path, sizeof (path));
- *((char **) p->data) = safe_strdup (path);
+ mutt_str_replace ((char **) p->data, path);
}
break;
case DT_ADDR: