Re: Folder names containing blanks [Was: Re: ANNOUNCE: balsa-1.3.2 released.]



On 2002.03.07 16:03 Thomas Maeder wrote:
[ snip ]
> I have just tracked the bug down:
> 
> Around browse.c:383, if state->folder points to a string containing 
> blanks, mx.mbox is unquoted ("Mail/A Folder With Blanks/") while name 
> is quoted ("\"Mail/A Folder With Blanks/\""). This means that 
> mutt_strncmp() doesn't return 0, which in turns causes the phantom 
> folder to be added.
> 
> I see three different possibilities to correct this:
> - imap_parse_path could quote mx.mbox
> - imap_parse_list_response could not quote name
> - something like mutt_strstr() could be used instead of mutt_strncmp()
> 
> I have tried the second one: below imap.c:1352, I replaced
> 
> else
>   *name =s;
> 
> with
> 
> else
> {
>   if (*s=='"')
>   {
>     ++s;
>     s[strlen(s)-1] = 0;
>   }
>   *name =s;
> }
> 
> i.e. I unquote s if it starts with a quote. Like this, I don't get 
> the phantom folders any more - I really like it!

Good work--I guess you had the motivation!

There's a function imap_unquote_string() in libmutt/imap/util.c that 
allows for more general messing around with strings, so perhaps

   else
   {
     imap_unquote_string(s);
     *name = s;
   }

would be more careful.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]