Subject: expanded-view-of-folders bug (patch included)

From: Jacob Morzinski <[email-masked]>
Date: Mon, 27 Mar 2000 03:46:28 -0500 (EST)

I'm not sure if the is the right place to send bug reports
and fixes.  Hopefully, some previous mail that I sent to 
[email-masked] didn't get lost in the noise.  I'll
send this one here, though.

While trying to set up the combination of combined-folder-display
and expanded-view-of-folders, I noticed that pine can get
confused when I try to open folders that are in a context other
that the one that I was in when I hit "L".  I'm including a patch
that should fix the problem.

The confusion is that pine tries to open the selected folder from
the previous context, rather than trying to open it from the
context that it is truly in.  This makes the combined, expanded
folder list nearly useless.

As an example, I have folder collections:

folder-collections="~/mail" mail/[],
	"IMAP Folders" {mit.edu/hesiod/imap}INBOX.[],
	"MH Folders" #mh/[]

If I'm reading a "#mh/[]" folder, go to the folder lister, and
try to select an imap folder (named "Saved"), pine gives me the
error message:
	    [Can't open mailbox #mh/Saved: no such folder]

The error message is correct -- there is no folder #mh/Saved,
there is only a {mumble/imap}INBOX.Saved .  Note that I selected
the name "Saved[.]" from the IMAP folder section of the
combined folder lister, and not the MH folder section.

The error only occurs on folder list entries that are both
directories and folders, and the simplest cause seems to be
because the "case MC_OPENFLDR" in folder.c's folder_processor()
neglects to set the overall context to the selection's context
before allowing pine to try to open the selected folder.

Applying the following patch to folder.c removes this bug from
the combined expanded folder lister, by setting the overall
context to the context of the highlighted folder when the
MC_OPENFLDR menu command is invoked.

Sincerely,
 Jacob Morzinski                                [email-masked]

*** pine4.21/pine/folder.c	2000/02/23 09:32:18	2.1
--- pine4.21/pine/folder.c	2000/03/27 08:10:39
***************
*** 2245,2251 ****
  	/*--------- Open the selected folder -----------*/
        case MC_OPENFLDR :
  	if(sparms->text.handles
! 	   && folder_total(FOLDERS(sparms->text.handles->h.f.context)))
  	  rv = folder_lister_finish(sparms, sparms->text.handles->h.f.context,
  				    sparms->text.handles->h.f.index);
  	else
--- 2245,2252 ----
  	/*--------- Open the selected folder -----------*/
        case MC_OPENFLDR :
  	if(sparms->text.handles
! 	   && folder_total(FOLDERS(sparms->text.handles->h.f.context))
! 	   && (FPROC(sparms)->fs->context = sparms->text.handles->h.f.context))
  	  rv = folder_lister_finish(sparms, sparms->text.handles->h.f.context,
  				    sparms->text.handles->h.f.index);
  	else

-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------