Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] Return nothing between if end index is not found.
@ 2010-07-18 17:53 Edward Z. Yang
  2010-07-19 22:50 ` Michael Stapelberg
  0 siblings, 1 reply; 12+ messages in thread
From: Edward Z. Yang @ 2010-07-18 17:53 UTC (permalink / raw)
  To: sup-devel

This patch fixed Nil error that occurred when I had a GPG signed
mail with a starting marker but no ending marker.

From 22d12ffe7caa0d11c91876e2c8c7806854d0b3ab Mon Sep 17 00:00:00 2001
From: Edward Z. Yang <ezyang@mit.edu>
Date: Sun, 18 Jul 2010 03:38:52 -0400
Subject: [PATCH] Return nothing between if end index is not found.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
---
 lib/sup/util.rb |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index d19caca..dad479f 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -479,6 +479,7 @@ module Enumerable
 
   ## returns all the entries which are equal to startline up to endline
   def between startline, endline
+    return [] if not index(endline)
     select { |l| true if l == startline .. l == endline }
   end
 end
-- 
1.7.0.4
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


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

end of thread, other threads:[~2010-09-09 19:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-18 17:53 [sup-devel] [PATCH] Return nothing between if end index is not found Edward Z. Yang
2010-07-19 22:50 ` Michael Stapelberg
2010-07-20 20:09   ` Michael Stapelberg
2010-08-15 23:30     ` Edward Z. Yang
2010-08-16  1:19       ` Michael Stapelberg
2010-08-16  1:40         ` Edward Z. Yang
2010-08-16 16:27           ` Alvaro Herrera
2010-08-16 17:22           ` Michael Stapelberg
2010-08-16 19:55             ` Edward Z. Yang
2010-08-17 22:46               ` Michael Stapelberg
2010-09-09 16:55                 ` Edward Z. Yang
2010-09-09 19:08                 ` Kevin Riggle

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