123 |
static int |
static int |
124 |
user_mailbox_name (const char *user, char **mailbox_name) |
user_mailbox_name (const char *user, char **mailbox_name) |
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 |
|
|
135 |
#ifdef USE_ENVIRON |
#ifdef USE_ENVIRON |
136 |
if (!user) |
if (!user) |
137 |
user = (getenv ("LOGNAME")) ? getenv ("LOGNAME") : getenv ("USER"); |
user = (getenv ("LOGNAME")) ? getenv ("LOGNAME") : getenv ("USER"); |
230 |
} |
} |
231 |
|
|
232 |
free (path); |
free (path); |
|
free (user); |
|
233 |
return *buf ? 0 : ENOMEM; |
return *buf ? 0 : ENOMEM; |
234 |
} |
} |
235 |
|
|