From d9cb9b4e7f2b1414578d5d8d56951173906e4507 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 29 Nov 2006 19:01:31 +0000 Subject: [PATCH] bugfixes: offset doesn't need to be +1, and message refs should be uniq'd before being added to the index git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@52 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- bin/sup-import | 1 - lib/sup/index.rb | 2 +- lib/sup/mbox/loader.rb | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/sup-import b/bin/sup-import index 94d9a61..0527700 100644 --- a/bin/sup-import +++ b/bin/sup-import @@ -54,7 +54,6 @@ The following options can also be specified: --optimize: optimize the index after adding any new messages. --help: don't do anything, just show this message. EOS -#' stupid ruby-mode exit end diff --git a/lib/sup/index.rb b/lib/sup/index.rb index 255e2f8..90bfc28 100644 --- a/lib/sup/index.rb +++ b/lib/sup/index.rb @@ -238,7 +238,7 @@ class Index :from => m.from ? m.from.email : "", :to => (m.to + m.cc + m.bcc).map { |x| x.email }.join(" "), :subject => wrap_subj(Message.normalize_subj(m.subj)), - :refs => (m.refs + m.replytos).join(" "), + :refs => (m.refs + m.replytos).uniq.join(" "), } @index.add_document d diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index f144683..51af5f2 100644 --- a/lib/sup/mbox/loader.rb +++ b/lib/sup/mbox/loader.rb @@ -85,7 +85,7 @@ class Loader next_end_offset = @f.tell while(line = @f.gets) break if line =~ BREAK_RE - next_end_offset = @f.tell + 1 + next_end_offset = @f.tell end end -- 2.45.2