From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIMWL_WL_MED autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 99fddbb6 for ; Mon, 24 Dec 2018 07:36:38 +0000 (UTC) Received: (qmail 10825 invoked by alias); 24 Dec 2018 07:36:26 -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: List-Unsubscribe: X-Seq: 43935 Received: (qmail 3704 invoked by uid 1010); 24 Dec 2018 07:36:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f181.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.166.181):SA:0(-1.9/5.0):. Processed in 4.23791 secs); 24 Dec 2018 07:36:25 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tZPf78boxlKpFZ6etzYuPCv0tUmdHBIMMwRc2myjmkg=; b=cmKMWZKkgaK59Yu34zPZai9xxVhQrU3jDA3Hg1fY/RibMLU4KgwzYmcqNpEUnXKsxm 0EJZS5lt69YrLoQRvnjr9gucW5bAqG/sQ9DJ6osM5J+BCmvTubvYVvzb/WOwSlkftZha 71h1R3vZ8l12otU3iM+wdn4dGvVmrx6zRIFm9WfhmgcHFjKd34+faoZ4vB27ovqP2BbV GdmR0IQquFWyrxAQDQzLkdFcqGq7jGqHKyLa9L5/k3Sveb8B3ORDrxue7roTiq9B4abz OX2xHgkYcqGF4Pwqp0eR2mc63JI0/6qiFlDAsWeEv/qPUKSX7POeRK40qesc86THGLkB QgQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tZPf78boxlKpFZ6etzYuPCv0tUmdHBIMMwRc2myjmkg=; b=KAqRaGuEYVwbgC3RPcXLJNw+j9XzMPPvo1z2KBrbseReaoXpzHFoy9N02t8jRP+nJM JOglJMPwqBeqscFLnndEG+kFD3W3neRZ9cEGDzYAvLmqDWJ6tKUK/Bqf+f+KqOcTbNOo FLiGL2VB7u1FM2Z0VSOIOf/s0PfdtKbiAT4nFAsiAMMwhdsOQ6Xegbeq3e/8LKKlC3p7 TSivizF2kFmlQXTm9IfNKuNkqn2ImfQDyRXYC08Jo1fr1uCQpmSeNyxIvrHPQfIdeIt3 LsOuU263iMVmbAp2DPuJCqwSc9CFn6VRlB/ZrjeQqc1TAfOMAfesIvbaFeZpYrRyp1pG 9cWw== X-Gm-Message-State: AA+aEWZ+6vwYn98AjiRdW9D89ATTl+Gw0MtPBlsZlivIRu7kUI8dul3n ZNATLI857uUjtjQbyxYrQFyS9ClB/51E5w== X-Google-Smtp-Source: AFSGD/U1+S+wGVLqz6zO4NWeicpY0wUEc9jnrkRJcrtKwRRyqwKRB5Yvl+gtVwkq+jn3sch9MXNufQ== X-Received: by 2002:a24:6f42:: with SMTP id x63mr7943198itb.152.1545636978938; Sun, 23 Dec 2018 23:36:18 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: zsh 5.6.2-test-2 From: dana In-Reply-To: <20181224071421.GL1941@sym.noone.org> Date: Mon, 24 Dec 2018 01:38:42 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181224054021.GK1941@sym.noone.org> <20181224071421.GL1941@sym.noone.org> To: Axel Beckert X-Mailer: Apple Mail (2.3445.100.39) On Mon, Dec 24, 2018 at 06:40:22AM +0100, Axel Beckert wrote: >And I suspect 5ad76492af8931added1ae9600309d915d1427a5 (43800: Add >nanosecond support to strftime built-in) to be the cause as the >nanosecond test is the one which fails (on i386 at least). Yes, it's my fault, i'm sorry. The test is wrong =E2=80=94 10 ** 9 is too many nanoseconds. I must not = have been paying attention, and just went with it because the built-in took it = anyway. I think it should probably not do that, to account for clever people = like me dana diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index 18c7fb58e..521c15a5b 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -148,7 +148,7 @@ output_strftime(char *nam, char **argv, Options ops, = UNUSED(int func)) } else if (*argv[2] =3D=3D '\0' || *endptr !=3D '\0') { zwarnnam(nam, "%s: invalid decimal number", argv[2]); return 1; - } else if (ts.tv_nsec < 0) { + } else if (ts.tv_nsec < 0 || ts.tv_nsec > 999999999) { zwarnnam(nam, "%s: invalid nanosecond value", argv[2]); return 1; } diff --git a/Test/V09datetime.ztst b/Test/V09datetime.ztst index 22d560750..da4dd4442 100644 --- a/Test/V09datetime.ztst +++ b/Test/V09datetime.ztst @@ -90,7 +90,7 @@ strftime '%Y-%m-%d %H:%M:%S.%3.' 1012615322 strftime '%Y-%m-%d %H:%M:%S.%3.' 1012615322 0 strftime '%Y-%m-%d %H:%M:%S.%3.' 1012615322 2 - strftime '%Y-%m-%d %H:%M:%S.%3.' 1012615322 $(( 222 * (10 ** 9) )) + strftime '%Y-%m-%d %H:%M:%S.%3.' 1012615322 $(( 222 * (10 ** 6) )) 0:optional nanoseconds >2002-02-02 02:02:02.000 >2002-02-02 02:02:02.000 @@ -103,6 +103,9 @@ strftime '%Y' 1012615322 '' 2> /dev/null 1:empty nanoseconds not allowed =20 + strftime '%N' 1012615322 $(( 222 * (10 ** 9) )) 2> /dev/null +1:too-large nanoseconds not allowed + strftime '%N' 1012615322 ${(l<64><9>):-} 2> /dev/null 1:overflowed nanoseconds not allowed =20