From 57f5683fd9dc9bc79816c418bb30fdbc33b68a8c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 17 Nov 2009 19:41:21 -0500 Subject: [PATCH] mail_user_*home_expand(): Use home_expand_tilde() instead of duplicating the code. --HG-- branch : HEAD --- src/lib-storage/mail-user.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.47.3