From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 3E4AD3858430 for ; Wed, 18 May 2022 20:57:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E4AD3858430 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=keithp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=keithp.com Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 3FEF13F32B0B; Wed, 18 May 2022 13:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1652907419; bh=dRKzBWojl5GIeIuSxdFpfBbk/x7yWNR4vmmTi/gO4Y8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=P/eVRokesTsM4/tpS3vM6BLaRSFdUSf678ySF7W0n9rHX4bJ0gZ9PBK1LKug2wfbu EgxbzQwwIL6R37m6r1HM8N602gYvc4GMwxHx06KHIY8r/2KhjiEL+M8E6ostCjV/Nc c7Af6br1sAP0M9j4JoEzoMR9s1JFih/N7u834+2TK+WjhptLiYbP4hJrVSOO797YVW wzrW8ozws80DqrpW7o/5MCsCUcWMvvqqXkGAHKs7fuGwqIeEuaiG5LnHUAlrRCUxGt H2KAwN4D1p/VwMdPMREs6FH3NeeEQo7TAmH7/glIZZsFC/PbcwZ4/c6WtMPfAB0yNg ZsGiyLchSeklg== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i-bQcT7f8jtO; Wed, 18 May 2022 13:56:58 -0700 (PDT) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 897B03F30F0E; Wed, 18 May 2022 13:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1652907418; bh=dRKzBWojl5GIeIuSxdFpfBbk/x7yWNR4vmmTi/gO4Y8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GlwomVYXNjrsG6BsN9ztUEXjnnI9TbZ5TOczkBNfFsr05CzbI228HKP5/vI2fBpyD bYg4f7eXLAknbzN8h7Pk3qDri0xbVnaRiXkQcuwr8xcpXj78cLYNT/oIrT2AdKyEuv +5zx0K9LnACVCUIZjlGZNyZB2grYeROgwlOMSVi2O/4wAZ91HC6ZTI1D6Bv+Og9paO 5pef7rGuMTpEzYWiUbCQg/3mEXnZlQowpPYWj32rUsd8f+rP2QhBPXOIECaudrn+Gh pik2D87nvhR2eqZMcShTkeUMG33VoDm6MBHTp5ZjnERfhwlbfFjI+5xIlvyY8BDD+i yYznUE95hr9Ww== Received: by keithp.com (Postfix, from userid 1000) id EEC7C1E601BB; Wed, 18 May 2022 13:56:57 -0700 (PDT) From: Keith Packard To: Dimitar Dimitrov , jdoubleu Cc: newlib@sourceware.org Subject: Re: [PATCH] update tzset tests In-Reply-To: References: <822e81a0-ed9f-200e-3318-0495456ad67e@SystematicSw.ab.ca> <20220407233425.2012-1-Brian.Inglis@SystematicSW.ab.ca> <9603e3aa-bd7d-6740-c710-27ace1d80397@SystematicSw.ab.ca> <25cfc7a2-2c66-f9fe-581b-8d3cec5d3bd9@jdoubleu.de> <426d1e93-6c4f-4ccc-9522-c187e10716f0@jdoubleu.de> <985b1a40-9c3a-9f7a-273d-86b59bc90265@jdoubleu.de> Date: Wed, 18 May 2022 13:56:57 -0700 Message-ID: <8735h6muee.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 20:57:01 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Dimitar Dimitrov writes: > On Tue, May 17, 2022 at 10:45:11AM +0200, jdoubleu wrote: >> Sorry, here's the patch. > > Hi jdoubleu, > > I managed to test your change with https://sourceware.org/pipermail/newli= b/2022/019710.html > > Only the following test case fails in tzset.c: > {"<+0123456789ABCDEF>3:33:33", IN_SECONDS(3, 33, 33), = NO_TIME}, // truncates the name (17 + 1) > Failure message is: > Assertion failed! Expected 1647906533 to equal 1647893720. winter > time, timezone =3D "<+0123456789ABCDEF>3:33:33" Yeah, the code needs a fix to truncate the TZ name but then skip to the '>' and keep going. Something like this (line numbers likely wrong; this patch is from picolibc= ): @@ -153,13 +55,8 @@ =20 /* quit if no items, too few or too many chars, or no close quote '>= ' */ if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_std, &n) <=3D 0 =2D || n < TZNAME_MIN || TZNAME_MAX < n) + || n < TZNAME_MIN || TZNAME_MAX < n || '>' !=3D tzenv[n]) return; =2D while (tzenv[n] !=3D '>') { =2D if (!tzenv[n]) =2D return; =2D n++; =2D } =20 ++tzenv; /* bump for close quote '>' */ } @@ -199,18 +96,13 @@ =20 /* quit if no items, too few or too many chars, or no close quote '>= ' */ if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_dst, &n) <=3D 0 =2D || n < TZNAME_MIN || TZNAME_MAX < n) + || n < TZNAME_MIN || TZNAME_MAX < n || '>' !=3D tzenv[n]) { /* No dst */ _tzname[1] =3D _tzname[0]; _timezone =3D tz->__tzrule[0].offset; _daylight =3D 0; =2D return; + return; } =2D while (tzenv[n] !=3D '>') { =2D if (!tzenv[n]) =2D return; =2D n++; =2D } =20 ++tzenv; /* bump for close quote '>' */ } =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmKFXZkACgkQ2yIaaQAA ABFOig//aurbi61e5wNxVqiHu9f7vG4gErCvykGDXsEC4vC8uixysAi9ZOuAIPhK Renb1Ow42Pc9HStkOh8SGo5jbVVFy0lWN/2HIThkLM89sdqRo+M+Gx5nNqkTjxXP 64r7mwa60GZMYIl2qXWculyyZiE7yfQ2tf8LhiTl2e4orAjA3kxtLWowHSH/p/vc at6ZAGTyTqf2ndCzWyMGhMJKa140cC1rCS9DvAbpakwUMkTHPdXjL1Un6CVIniHY I7mlhHwbUiWyBalDGGCBCJoanJETCT++ymmgonuyb4sEvdPojEcEqhjmWL8Atf0s troysvp5urnotIiwl7JZ8R5lmdnbqV3Ir3J8poCKiudTROPpKyVkP2u9tI1tD+n6 lT49PAgcybnFTuTjemUGACLDbgE5mecby5M9UKl9G4Oe+vEK0gcyQ7QwTkKFA3d6 tp1JmWF/4Wn9LEQk2ZfZ2kE5qQnwGO21ewer6XYVXUXxF0mi59voelH7OrNWLyaY Si3VuWt10jN51mDgIuBZhbjwJAWjIPSdeCSM67m9h1B5EvCtmDwKx3o2K4K/blaK eG1zgVI81L0r8t4iwdpoCptV+3JsfQi0HWzwvQzP8+RXsWyHXFfqBeJ8VuvTQKjK PVCqtwBWQldzPSzpx3LC5ZKcikGviZ9BrIaQJHmCp5MJ54K7TJ8= =XEvz -----END PGP SIGNATURE----- --=-=-=--