Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: ezyang@MIT.EDU (Edward Z. Yang)
Subject: [sup-talk] Bugfix for custom-search
Date: Thu, 01 Oct 2009 13:38:27 -0400	[thread overview]
Message-ID: <1254418685-sup-6611@javelin> (raw)

I think there's a slight bug in the custom-search implementation.
Patch is here:

From cea17180933469570e9502ffa7bf67ccaa8ccfc7 Mon Sep 17 00:00:00 2001
From: Edward Z. Yang <edwardzyang at thewritingpot.com>
Date: Wed, 10 Jun 2009 01:42:50 -0400
Subject: [PATCH] Fix bug in which custom-search substitutions are not used.

Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
---
 lib/sup/ferret_index.rb |    2 +-
 lib/sup/xapian_index.rb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/ferret_index.rb b/lib/sup/ferret_index.rb
index d605e8d..34dff87 100644
--- a/lib/sup/ferret_index.rb
+++ b/lib/sup/ferret_index.rb
@@ -340,7 +340,7 @@ EOS
     query = {}
 
     subs = HookManager.run("custom-search", :subs => s) || s
-    subs = s.gsub(/\b(to|from):(\S+)\b/) do
+    subs = subs.gsub(/\b(to|from):(\S+)\b/) do
       field, name = $1, $2
       if(p = ContactManager.contact_for(name))
         [field, p.email]
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index ab25ea0..e1cfe65 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -193,7 +193,7 @@ EOS
     query = {}
 
     subs = HookManager.run("custom-search", :subs => s) || s
-    subs = s.gsub(/\b(to|from):(\S+)\b/) do
+    subs = subs.gsub(/\b(to|from):(\S+)\b/) do
       field, name = $1, $2
       if(p = ContactManager.contact_for(name))
         [field, p.email]
-- 
1.6.4.4


             reply	other threads:[~2009-10-01 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 17:38 Edward Z. Yang [this message]
2009-10-06 22:44 ` Edward Z. Yang
2009-10-12 13:51   ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254418685-sup-6611@javelin \
    --to=ezyang@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox