dovecot-2.0-sslstream: mail_user_*home_expand(): Use home_expand...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:56:30 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/ffac955d80ef
changeset: 10352:ffac955d80ef
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 17 19:41:21 2009 -0500
description:
mail_user_*home_expand(): Use home_expand_tilde() instead of duplicating the code.

diffstat:

1 file changed, 6 insertions(+), 6 deletions(-)
src/lib-storage/mail-user.c |   12 ++++++------

diffs (29 lines):

diff -r d1d810348e65 -r ffac955d80ef src/lib-storage/mail-user.c
--- a/src/lib-storage/mail-user.c	Tue Nov 17 19:35:21 2009 -0500
+++ b/src/lib-storage/mail-user.c	Tue Nov 17 19:41:21 2009 -0500
@@ -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 mai
 	if (mail_user_get_home(user, &home) < 0)
 		return -1;
 
-	if (path[0] == '~' && (path[1] == '/' || path[1] == '\0')) {
-		if (home == NULL)
-			return -1;
-
-		*pathp = t_strconcat(home, path + 1, NULL);
-	}
+	path = home_expand_tilde(path, home);
+	if (path == NULL)
+		return -1;
+
+	*pathp = path;
 	return 0;
 }
 


More information about the dovecot-cvs mailing list