From: Roni Choudhury <roni@cs.utah.edu>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCH] eliminated nil-to-integer error when standard library ruby code calls make_tmpname with n=nil
Date: Mon, 21 Feb 2011 14:17:04 -0700 [thread overview]
Message-ID: <1298322910-sup-1012@medusa> (raw)
I was getting an error from monkeypatched code that didn't seem to
call into the standard library properly... this patch seemed to fix
things for me, but I didn't fully understand what was going on here.
roni
---
lib/sup/message-chunks.rb | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index c275f41..90137da 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -34,7 +34,11 @@ require 'tempfile'
## monkey-patch time: make temp files have the right extension
class Tempfile
def make_tmpname basename, n
- sprintf '%d-%d-%s', $$, n, basename
+ if n == nil
+ sprintf '%d-nil-%s', $$, basename
+ else
+ sprintf '%d-%d-%s', $$, n, basename
+ end
end
end
--
1.7.3.2
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2011-02-21 21:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 21:17 Roni Choudhury [this message]
2011-02-21 23:26 ` Alvaro Herrera
2011-02-21 23:54 ` Roni Choudhury
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=1298322910-sup-1012@medusa \
--to=roni@cs.utah.edu \
--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