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



Am 2002.03.03 22:00 schrieb(en) Thomas Maeder:
> 
> I can reproduce this behavior for two directories I have just created
> for the purpose:
> 
> Mail/AFolderWithoutBlank/
> Mail/AFolderWithoutBlank/ChildOfFolderWithoutBlank
> Mail/A Folder With Blanks/
> Mail/A Folder With Blanks/ChildOfFolderWithBlanks
> 
> Balsa 1.2.4 displays a phantom folder under Mail/A Folder With Blanks/
> , but not under Mail/AFolderWithoutBlank/

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!

It would be nice if somebody more involved in Balsa than could verify 
my observation, decide which option to choose and introduce a 
production quality correction.



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