Mercurial > dovecot > original-hg > dovecot-1.2
diff src/deliver/deliver.c @ 6358:6bd13d514294 HEAD
Fixed home directory handling which got broken by previous changes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 09 Sep 2007 03:58:57 +0300 |
parents | 8476d665530f |
children | 7f6c99dc1f17 |
line wrap: on
line diff
--- a/src/deliver/deliver.c Sat Sep 08 03:50:25 2007 +0300 +++ b/src/deliver/deliver.c Sun Sep 09 03:58:57 2007 +0300 @@ -516,12 +516,14 @@ static void expand_envs(const char *destination) { const struct var_expand_table *table; - const char *mail_env, *const *envs; + const char *mail_env, *const *envs, *home; unsigned int i, count; string_t *str; + home = getenv("HOME"); + str = t_str_new(256); - table = get_var_expand_table(destination, getenv("HOME")); + table = get_var_expand_table(destination, home); envs = array_get(&plugin_envs, &count); for (i = 0; i < count; i++) { str_truncate(str, 0); @@ -533,7 +535,9 @@ if (mail_env != NULL) { /* get the table again in case plugin envs provided the home directory (yea, kludgy) */ - table = get_var_expand_table(destination, getenv("HOME")); + if (home == NULL) + home = getenv("HOME"); + table = get_var_expand_table(destination, home); mail_env = expand_mail_env(mail_env, table); } env_put(t_strconcat("MAIL=", mail_env, NULL));