From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8883 invoked by alias); 11 Aug 2013 18:44:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31650 Received: (qmail 7760 invoked from network); 11 Aug 2013 18:43:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.83.45 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=msQC84E2vnwjkaFJgc6h1ueD6oGHRgXA21wCrWfJDVw=; b=jviA7Lx9fvQtATmuoAnXcDWsNCQwvjjyeXDivC1gt9T3mDtLBcboP8vYbrDKzz8oT4 aO40qkZjqJLYva2invKIj3x/ZUx+pfbY9LgHVrLBdNIz2eHdW7RjPdEDKXXDnhgWCtl8 tA64aMMhk2cadVlUEFdaNpunjg/OitwSeM86DYr8TAkHS7jvRm6xy1sp+xwhpycmNE5z jnaYeA/9dMQ41tn2P7NRNfNMSHXrK5L0bYl3799ejVbxOLCJP3X+/jgaxHNyb3jebH99 71Sr2A98BaQUJvuBPu4wa4zwVx486T1GlpLNokDsBltT8hwAVVVr7R1M2oO8StP2lEPp MIzQ== X-Gm-Message-State: ALoCoQmBxlW2xUuCvSaypcsY0zMPLx1PjRliuhp5SOzWnn4OxjOJ5oU9QsKq2z7HB0t1Lvj7dRKU X-Received: by 10.14.176.199 with SMTP id b47mr22324113eem.117.1376246200762; Sun, 11 Aug 2013 11:36:40 -0700 (PDT) X-ProxyUser-IP: 86.6.30.159 Date: Sun, 11 Aug 2013 19:36:37 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: patch to mailcheck missing new emails Message-ID: <20130811193637.3e42fa6b@pws-pc.ntlworld.com> In-Reply-To: <20130810195138.3472046a@pws-pc.ntlworld.com> References: <20130810195138.3472046a@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 10 Aug 2013 19:51:38 +0100 Peter Stephenson wrote: > (Separate issue noted in passing: we should probably use zlong for > period and mailcheck to be safe; efficiency isn't really an issue.) Joe sent me a patch, but I'd already done the following (very similar) which I might as well post... diff --git a/Src/utils.c b/Src/utils.c index 6d9ffe3..d1d9406 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1289,8 +1289,8 @@ preprompt(void) static time_t lastperiodic; time_t currentmailcheck; LinkNode ln; - int period = getiparam("PERIOD"); - int mailcheck = getiparam("MAILCHECK"); + zlong period = getiparam("PERIOD"); + zlong mailcheck = getiparam("MAILCHECK"); /* * Handle any pending window size changes before we compute prompts, @@ -1338,7 +1338,7 @@ preprompt(void) /* If 1) the parameter PERIOD exists, 2) a hook function for * * "periodic" exists, 3) it's been greater than PERIOD since we * * executed any such hook, then execute it now. */ - if (period && (time(NULL) > lastperiodic + period) && + if (period && ((zlong)time(NULL) > (zlong)lastperiodic + period) && !callhookfunc("periodic", NULL, 1, NULL)) lastperiodic = time(NULL); if (errflag) @@ -1358,7 +1358,7 @@ preprompt(void) /* Check mail */ currentmailcheck = time(NULL); if (mailcheck && - (int) difftime(currentmailcheck, lastmailcheck) > mailcheck) { + (zlong) difftime(currentmailcheck, lastmailcheck) > mailcheck) { char *mailfile; if (mailpath && *mailpath && **mailpath) -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/