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 /init.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 'init.c')
-rw-r--r-- | init.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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: |