Commit 9cfd5000 9cfd5000c16ba26485610f65d949addd65bdae1d by Sergey Poznyakoff

(user_mailbox_name): Operate only on mbox: and path URLs.

1 parent fa0ce32f
...@@ -123,6 +123,15 @@ get_homedir (const char *user) ...@@ -123,6 +123,15 @@ get_homedir (const char *user)
123 static int 123 static int
124 user_mailbox_name (const char *user, char **mailbox_name) 124 user_mailbox_name (const char *user, char **mailbox_name)
125 { 125 {
126 char *p;
127
128 p = strchr (mu_path_maildir, ':');
129 if (p && strncmp (mu_path_maildir, "mbox", p - mu_path_maildir))
130 {
131 *mailbox_name = strdup (mu_path_maildir);
132 return 0;
133 }
134
126 #ifdef USE_ENVIRON 135 #ifdef USE_ENVIRON
127 if (!user) 136 if (!user)
128 user = (getenv ("LOGNAME")) ? getenv ("LOGNAME") : getenv ("USER"); 137 user = (getenv ("LOGNAME")) ? getenv ("LOGNAME") : getenv ("USER");
...@@ -221,7 +230,6 @@ tilde_expand (const char *file, char **buf) ...@@ -221,7 +230,6 @@ tilde_expand (const char *file, char **buf)
221 } 230 }
222 231
223 free (path); 232 free (path);
224 free (user);
225 return *buf ? 0 : ENOMEM; 233 return *buf ? 0 : ENOMEM;
226 } 234 }
227 235
......