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

Re: folder ending with '/'



Applied, thanks.

On Thursday, 08 March 2007 at 00:06, Antoine Reilles wrote:
> 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
> @@ -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: pgpZXhaRn4Iva.pgp
Description: PGP signature