(read_mts_profile): Allow .mtstailor to override system-wide configuration values.
Showing
1 changed file
with
8 additions
and
9 deletions
... | @@ -275,18 +275,17 @@ void | ... | @@ -275,18 +275,17 @@ void |
275 | read_mts_profile () | 275 | read_mts_profile () |
276 | { | 276 | { |
277 | char *p; | 277 | char *p; |
278 | 278 | mh_context_t *local_profile; | |
279 | |||
279 | p = mh_expand_name (MHLIBDIR, "mtstailor", 0); | 280 | p = mh_expand_name (MHLIBDIR, "mtstailor", 0); |
280 | if (!p) | ||
281 | { | ||
282 | char *home = mu_get_homedir (); | ||
283 | if (!home) | ||
284 | abort (); /* shouldn't happen */ | ||
285 | asprintf (&p, "%s/%s", home, ".mtstailor"); | ||
286 | free (home); | ||
287 | } | ||
288 | mts_profile = mh_context_create (p, 1); | 281 | mts_profile = mh_context_create (p, 1); |
289 | mh_context_read (mts_profile); | 282 | mh_context_read (mts_profile); |
283 | |||
284 | p = mu_tilde_expansion ("~/.mtstailor", "/", NULL); | ||
285 | local_profile = mh_context_create (p, 1); | ||
286 | if (mh_context_read (local_profile) == 0) | ||
287 | mh_context_merge (mts_profile, local_profile); | ||
288 | mh_context_destroy (&local_profile); | ||
290 | } | 289 | } |
291 | 290 | ||
292 | 291 | ... | ... |
-
Please register or sign in to post a comment