Re: Messages saved in reverse order

Steve Hubert <[email protected]>
Newsgroups gmane.mail.pine.general
Organization Univ of Washington; Computing and Communications; Seattle
Message-ID <[email protected]>
Steve,
   Your diagnosis and fix looks correct. Attached is a patch which also 
causes multiappend to be used in this case to get the faster performance 
you noted in the special-handling code. The imap_proxycopy code should 
only be executed when copying between mailboxes of two different formats, 
so maybe you were copying from a Unix format mailbox (or something) to the 
Tenex format mailbox. Thanks for the bug report.

Steve

_______________________________________________
Pine-info mailing list
[email protected]
http://mailman1.u.washington.edu/mailman/listinfo/pine-info
patch.mailcmd.c (text/plain, 1.4 KB)
*** pine/mailcmd.c.orig	2006-06-12 15:56:48.000000000 -0700
--- pine/mailcmd.c	2006-06-12 15:56:51.000000000 -0700
***************
*** 3887,3900 ****
       * we have to fall thru below to do the APPEND by hand...
       */
      if(!msgno_any_deletedparts(stream, msgmap)){
  	/*
  	 * Compare the current stream (the save's source) and the stream
  	 * the destination folder will need...
  	 */
  	context_apply(tmp, context, save_folder, sizeof(tmp));
!         save_stream = (stream && stream->dtb
! 		       && stream->dtb->flags & DR_LOCAL) && !IS_REMOTE(tmp) ?
! 	  stream : context_same_stream(context, save_folder, stream);
      }
  
      /* if needed, this'll get set in mm_notify */
--- 3887,3904 ----
       * we have to fall thru below to do the APPEND by hand...
       */
      if(!msgno_any_deletedparts(stream, msgmap)){
+ 	int loc_to_loc;
+ 
  	/*
  	 * Compare the current stream (the save's source) and the stream
  	 * the destination folder will need...
  	 */
  	context_apply(tmp, context, save_folder, sizeof(tmp));
! 	loc_to_loc = stream && stream->dtb
! 			&& stream->dtb->flags & DR_LOCAL && !IS_REMOTE(tmp);
! 	if(!loc_to_loc || (stream->dtb->valid && (*stream->dtb->valid)(tmp)))
!           save_stream = loc_to_loc ? stream
! 				   : context_same_stream(context, save_folder, stream);
      }
  
      /* if needed, this'll get set in mm_notify */
patch.imap.c (text/plain, 1.1 KB)
*** pine/imap.c.orig	2006-06-12 15:34:29.000000000 -0700
--- pine/imap.c	2006-06-12 15:34:31.000000000 -0700
***************
*** 2682,2694 ****
  	    if (i > j) {		/* swap the range if backwards */
  		x = i; i = j; j = x;
  	    }
- 				/* mark each item in the sequence */
- 	    while (i <= j)
- 	      if(!(*func)(stream, j--, args)){
- 		  if(j > 0L && stream && j <= stream->nmsgs
- 		     && (mc = mail_elt(stream, j)))
- 		    mc->sequence = T;
  
  		  return(0L);
  	      }
  
--- 2682,2690 ----
  	    if (i > j) {		/* swap the range if backwards */
  		x = i; i = j; j = x;
  	    }
  
+ 	    while (i <= j)
+ 	      if(!(*func)(stream, i++, args)){
  		  return(0L);
  	      }
  
***************
*** 2697,2706 ****
  	    ++sequence;		/* skip the delimiter, fall into end case */
  	  case '\0':		/* end of sequence, mark this message */
  	    if(!(*func)(stream, i, args)){
- 		if(i > 0L && stream && i <= stream->nmsgs
- 		   && (mc = mail_elt(stream, i)))
- 		  mc->sequence = T;
- 
  		return(0L);
  	    }
  
--- 2693,2698 ----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.