From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.87.14 with SMTP id k14cs1373318agb; Fri, 1 Jan 2010 14:14:04 -0800 (PST) Received: by 10.224.23.131 with SMTP id r3mr9888917qab.273.1262384044008; Fri, 01 Jan 2010 14:14:04 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 26si27930209qyk.38.2010.01.01.14.14.03; Fri, 01 Jan 2010 14:14:04 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id B5FCF19782D9; Fri, 1 Jan 2010 17:14:03 -0500 (EST) Received: from magnesium.club.cc.cmu.edu (MAGNESIUM.CLUB.CC.cmu.edu [128.237.157.15]) by rubyforge.org (Postfix) with ESMTP id 633021858291 for ; Fri, 1 Jan 2010 17:14:01 -0500 (EST) Received: (qmail 32206 invoked from network); 1 Jan 2010 22:14:01 -0000 Received: from pion.club.cc.cmu.edu (HELO localhost.localdomain) (128.237.157.88) by magnesium.club.cc.cmu.edu with SMTP; 1 Jan 2010 22:14:01 -0000 From: Rich Lane To: sup-devel@rubyforge.org Date: Fri, 1 Jan 2010 14:14:00 -0800 Message-Id: <1262384040-27801-1-git-send-email-rlane@club.cc.cmu.edu> X-Mailer: git-send-email 1.6.3.3 Subject: [sup-devel] [PATCH] ruby 1.9: expect nil start_offset when an MBox::Loader is first created X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Various callers (including sup-add) passed a nil start_offset. Through a convoluted path probably involving the fact that nil.to_i == 0, this did the right thing on Ruby 1.8. It crashes on 1.9, so change initialize to expect a nil offset and replace it with 0. --- lib/sup/mbox/loader.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index 520e2ec..54d227d 100644 --- a/lib/sup/mbox/loader.rb +++ b/lib/sup/mbox/loader.rb @@ -12,7 +12,7 @@ class Loader < Source attr_reader :labels ## uri_or_fp is horrific. need to refactor. - def initialize uri_or_fp, start_offset=0, usual=true, archived=false, id=nil, labels=nil + def initialize uri_or_fp, start_offset=nil, usual=true, archived=false, id=nil, labels=nil @mutex = Mutex.new @labels = Set.new((labels || []) - LabelManager::RESERVED_LABELS) @@ -29,6 +29,7 @@ class Loader < Source @path = uri_or_fp.path end + start_offset ||= 0 super uri_or_fp, start_offset, usual, archived, id end -- 1.6.3.3 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel