<<< Date Index >>>     <<< Thread Index >>>

folder ending with '/'



Dear mutters,

While playing with change-folder-next, i noticed that buffy-cycle wasn't
working properly when i had in my config
  set folder=~/Mail/
and was only listing the first mailbox with new mails.
the problem was that it uses a comparison in mutt_buffy
where the first argument is of the form
...Mail//somewhere and the second of the form 
...Mail/somewhereelse
thus failing to cycle new mailboxes.

It appears that the "mutt_expand_path" finction takes care to avoid
duplicating / for imap boxes, but not for directory names.
I think mutt should either do the same for folders, or tell the user
having a folder with a trainling / is not good. The former looks a
better idea. Here is a tentative patch, that seems to fix the problem.

Best regards,
antoine
--- muttlib.c.orig      2007-01-30 20:49:02.000000000 +0100
+++ muttlib.c
@@ -397,6 +397,9 @@ char *_mutt_expand_path (char *s, size_t
          strfcpy (p, NONULL (Maildir), sizeof (p));
        else
 #endif
+       if (Maildir[strlen (Maildir) - 1] == '/')
+         strfcpy (p, NONULL (Maildir), sizeof (p));
+       else
          snprintf (p, sizeof (p), "%s/", NONULL (Maildir));
        
        tail = s + 1;

Attachment: pgpbzX6ylp7yX.pgp
Description: PGP signature