a32d983
# HG changeset patch
a32d983
# User Timo Sirainen <tss@iki.fi>
a32d983
# Date 1334041779 -10800
a32d983
# Node ID 20e1aa322b1e3b7d47c7cb1b6ff68a8d07fe6c9d
a32d983
# Parent  0b59dbb1a288153d2eb26d47cd9f7a953335c66f
a32d983
lib-storage: mail_user_try_home_expand() now looks up home only when needed.
a32d983
Before a recent code cleanup the lookup was always done, but if the home
a32d983
didn't exist it still just happened to return success. The cleanup changed
a32d983
it to return failure, which broke the original behavior.
a32d983
a32d983
diff -r 0b59dbb1a288 -r 20e1aa322b1e src/lib-storage/mail-user.c
a32d983
--- a/src/lib-storage/mail-user.c	Tue Apr 10 09:52:35 2012 +0300
a32d983
+++ b/src/lib-storage/mail-user.c	Tue Apr 10 10:09:39 2012 +0300
a32d983
@@ -343,6 +343,11 @@
a32d983
 {
a32d983
 	const char *home, *path = *pathp;
a32d983
 
a32d983
+	if (strncmp(path, "~/", 2) != 0) {
a32d983
+		/* no need to expand home */
a32d983
+		return 0;
a32d983
+	}
a32d983
+
a32d983
 	if (mail_user_get_home(user, &home) <= 0)
a32d983
 		return -1;
a32d983
 
a32d983
a32d983