public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Christopher Wong <Christopher.Wong@axis.com>
To: Florian Weimer <fweimer@redhat.com>,
	Christopher Wong via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] time: Remove assert in reading of tz file
Date: Mon, 6 Dec 2021 15:16:02 +0000	[thread overview]
Message-ID: <996f5c750c404c76b361b0873cf46006@axis.com> (raw)
In-Reply-To: <87mtldojl3.fsf@oldenburg.str.redhat.com>

This patch is needed if the tzfile is compiled using the truncated option -r in 2021d and later.


I know how to create the zone file, but I haven't run the test case before. Would probably take me some time to put that up.


Best Regards,

Christopher Wong
________________________________
From: Florian Weimer <fweimer@redhat.com>
Sent: Monday, December 6, 2021 4:10:16 PM
To: Christopher Wong via Libc-alpha
Cc: Christopher Wong
Subject: Re: [PATCH] time: Remove assert in reading of tz file

* Christopher Wong via Libc-alpha:

> diff --git a/time/tzfile.c b/time/tzfile.c
> index 190a777152..874e10c9c7 100644
> --- a/time/tzfile.c
> +++ b/time/tzfile.c
> @@ -429,12 +429,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
>        }
>      }
>    if (__tzname[0] == NULL)
> -    {
> -      /* This should only happen if there are no transition rules.
> -      In this case there should be only one single type.  */
> -      assert (num_types == 1);
> -      __tzname[0] = __tzstring (zone_names);
> -    }
> +    __tzname[0] = __tzstring (zone_names);
>    if (__tzname[1] == NULL)
>      __tzname[1] = __tzname[0];

Is this patch required to avoid an assert with 2021d and later?

Would you be able to add a test case using a precomputed zone file?

Thanks,
Florian


  reply	other threads:[~2021-12-06 15:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 14:50 Christopher Wong
2021-12-06 15:10 ` Florian Weimer
2021-12-06 15:16   ` Christopher Wong [this message]
2021-12-17  0:57   ` [PATCH v2] timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707) Hans-Peter Nilsson
2021-12-17  2:51     ` Paul Eggert
2021-12-17 14:05       ` Carlos O'Donell
2021-12-17 20:33         ` Hans-Peter Nilsson
2021-12-17 14:24       ` Carlos O'Donell
2021-12-17 17:57         ` Paul Eggert
2021-12-17 18:11           ` Hans-Peter Nilsson
2021-12-17 18:40             ` Paul Eggert
2021-12-17 20:36       ` [PATCH v3 0/2] timezone: BZ #28707 Hans-Peter Nilsson
2021-12-17 22:22         ` Paul Eggert
2021-12-29  0:50         ` Hans-Peter Nilsson
2021-12-29 23:12           ` Adhemerval Zanella
2021-12-17 20:38       ` [PATCH v3 1/2] timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707) Hans-Peter Nilsson
2021-12-17 20:45       ` [PATCH v3 2/2] timezone: test-case for BZ #28707 Hans-Peter Nilsson
2021-12-17 20:51         ` Hans-Peter Nilsson

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=996f5c750c404c76b361b0873cf46006@axis.com \
    --to=christopher.wong@axis.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).