Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Maildir source with one message
@ 2008-03-03  7:07 Christopher Warrington
  2008-03-03  8:00 ` [sup-talk] [PATCH] fixed off-by-one error in imap.rb and maildir.rb Christopher Warrington
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Warrington @ 2008-03-03  7:07 UTC (permalink / raw)


In playing with offline IMAP and Maildir sources (much faster than a native IMAP source and it can be used offline!), I noticed an odd bug.

If there is only one message in a Maildir source, neither sup not
sup-sync can see this message. Adding another message makes both
visible messages visible.

--- here begins speculation ---

I *THINK* that this has to do with the definitions Source.start_offset
and Source.end_offset. As I understand it, they should define a range
of message ids [start_offset, end_offset).

Now, when start_offset = end_offset--as is the case when there is only
one message, bad things happen. As I understand the math:
(a,a) = {}
[a,a) = {} *our case
(a,a] = {}
[a,a] = {a.

Changing maildir.rb:126 from:
    @ids.last
to
    @ids.last + 1
appears to have fixed the problem without ill-effect.

Simple inspection of imap.rp leads be to believe that it will have the
same problem.

A mbox source will have the same problem iff the mbox is empty.

--- here ends speculation ---

-- 
Christopher Warrington <chrisw at rice.edu>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-04 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03  7:07 [sup-talk] Maildir source with one message Christopher Warrington
2008-03-03  8:00 ` [sup-talk] [PATCH] fixed off-by-one error in imap.rb and maildir.rb Christopher Warrington
2008-03-26 16:04   ` William Morgan
2008-04-03 16:35     ` Grant Hollingworth
2008-04-04 17:48       ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox