From: Gaute Hope <eg@gaute.vetsj.com>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [PATCH] Don't fail on empty lines while expanding
Date: Thu, 13 Oct 2011 12:10:27 +0200 [thread overview]
Message-ID: <1318500554-sup-8811@qwerzila> (raw)
While expanding an GPG signature which must have contained a line that
ended up as nil while chomp'ing, chomp will crash. This patch filters
out lines which are nil.
---
lib/sup/modes/thread-view-mode.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 9fcc45d..ec1a82e 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -846,7 +846,7 @@ private
else
width = buffer.content_width
end
- lines = lines.map { |l| l.chomp.wrap width }.flatten
+ lines = lines.map { |l| l.chomp.wrap width if l }.flatten
end
return lines
end
--
1.7.7
next reply other threads:[~2011-10-13 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 10:10 Gaute Hope [this message]
2011-12-17 18:46 ` [sup-devel] " Hamish D
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=1318500554-sup-8811@qwerzila \
--to=eg@gaute.vetsj.com \
--cc=sup-devel@rubyforge.org \
/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