From: Timo Sirainen Date: Wed, 18 Nov 2009 00:41:21 +0000 (-0500) Subject: mail_user_*home_expand(): Use home_expand_tilde() instead of duplicating the code. X-Git-Tag: 2.0.beta1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57f5683fd9dc9bc79816c418bb30fdbc33b68a8c;p=thirdparty%2Fdovecot%2Fcore.git mail_user_*home_expand(): Use home_expand_tilde() instead of duplicating the code. --HG-- branch : HEAD --- diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index a7b32f4998..fd5ee22964 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -4,6 +4,7 @@ #include "array.h" #include "hostpid.h" #include "network.h" +#include "home-expand.h" #include "str.h" #include "strescape.h" #include "var-expand.h" @@ -310,12 +311,11 @@ int mail_user_try_home_expand(struct mail_user *user, const char **pathp) if (mail_user_get_home(user, &home) < 0) return -1; - if (path[0] == '~' && (path[1] == '/' || path[1] == '\0')) { - if (home == NULL) - return -1; + path = home_expand_tilde(path, home); + if (path == NULL) + return -1; - *pathp = t_strconcat(home, path + 1, NULL); - } + *pathp = path; return 0; }