]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail_user_*home_expand(): Use home_expand_tilde() instead of duplicating the code.
authorTimo Sirainen <tss@iki.fi>
Wed, 18 Nov 2009 00:41:21 +0000 (19:41 -0500)
committerTimo Sirainen <tss@iki.fi>
Wed, 18 Nov 2009 00:41:21 +0000 (19:41 -0500)
--HG--
branch : HEAD

src/lib-storage/mail-user.c

index a7b32f49980a9c3313454bff320a556ef3126f08..fd5ee2296410e60373774a8605c90a36c798b7b9 100644 (file)
@@ -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;
 }