Commit dd881c96 dd881c96d869e5f8f87d733718c022d566bb503b by Sergey Poznyakoff

Properly handle --user (open user's system mailbox).

1 parent ae7d6e4d
...@@ -341,7 +341,17 @@ main (int argc, char **argv) ...@@ -341,7 +341,17 @@ main (int argc, char **argv)
341 /* open the mailbox */ 341 /* open the mailbox */
342 if (args.file == NULL) 342 if (args.file == NULL)
343 { 343 {
344 if ((rc = mailbox_create_default (&mbox, args.user)) != 0) 344 if (args.user)
345 {
346 char *p = xmalloc (strlen (args.user) + 2);
347 p[0] = '%';
348 strcpy (p + 1, args.user);
349 rc = mailbox_create_default (&mbox, p);
350 free (p);
351 }
352 else
353 rc = mailbox_create_default (&mbox, NULL);
354 if (rc != 0)
345 { 355 {
346 util_error ("Can not create mailbox for %s: %s", args.user, 356 util_error ("Can not create mailbox for %s: %s", args.user,
347 mu_errstring (rc)); 357 mu_errstring (rc));
......