From nobody Wed Oct 22 17:52:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4csGvz43fbz6D0VM; Wed, 22 Oct 2025 17:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4csGvz303xz3w6k; Wed, 22 Oct 2025 17:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761155551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GEkhlkx7MHWJwRuVGMunUoegRtHTWY0yv2t+IHvK5i4=; b=Z25MT8m5JHqQYLrZyH8rQiZ8C5pKTy6KrH9ZyICNfIaEevlKoznr+4FtAbzUvDuVY57BYJ OHcAKXimASooYnQJMGW4cq4rwYjWGoLiEOGT3FG/GjGCgGowxkOueeY2N4iDIWdvbvBiTX O6AOeeOCHWYIxP3xSIKPM55H3oVMbpMLd+crW5KxX1LJ7WzvH9O2CnqBMUheNnW/Ie2AYb Q7nc+ycJjHVi9W92kDnvh7MFRY8ioV2WU/BCiXwwSN5KniVqCEtqzSvPewrfUfq4Ch9tGf YCosp2E/EfwaRxLIfvnNOTGr0KBxnM7FUb8uNEOOu/7icYjgm5ohvycgD+Hzrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761155551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GEkhlkx7MHWJwRuVGMunUoegRtHTWY0yv2t+IHvK5i4=; b=k2mbFH2UqKSMyFV+2BdfCpOrhzL/hbGOUH7S0aUUHVEag9ulOLX8/jGaHdDPSr71IYhkID bGt41RmZuYwlglzrKlEUSfH6M2PllmWwI64wbB4YMtuv/Q1wydROB6HfdKHmdDvwLh2sJw TBWCErsai3f2KBToGgrzLrroI/fvCPZSdMrD9nPMBA030LdVcA5adfXbbyOUxoeuFZvsow wE0Ss1MtLmFEz/++K8s5xfrw17dsqN6igUycG/Rzax+JKOkqxH9KFvckxsnyzn4XmxwD7C HGoi5UhIp/USlNMwWPxvUx6SvV0XECFpKp0fmc9asPrYa+k5kpIZrCMbd3HcjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761155551; a=rsa-sha256; cv=none; b=BiCsYr6+K9mzyw/VeYm3GRVbNWN38nlBVlmr83jq9iHoZe7EUDyT5KYN/tVJGeqgubW5Vo eG6dY+J9+W8jLFgBURqsVPbSWqblzgX5UAfeitE8wlVKM6qpM1KzHLj8eoLCaZ+pAZJ7wG zaup/WWAOSsxA4bz7oATk2Izn3JpDOeef694vw/xBWexv9XDUdCzrVjiCPPIbu5caCAsEn QVqEHIp2m4zZ8NbY4YGDSH9Hf2MJc3EaoOpw8om1xKZownAtmLE5lyuhJ2rcIrs/TXsqso LHRKpdYgrrZ99TXl4Eh9Cbk+tTvsGUwN+f4pISlKQu39WCKIsMmRPzgGtNlptQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4csGvz2QLPzgBY; Wed, 22 Oct 2025 17:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59MHqVP0065933; Wed, 22 Oct 2025 17:52:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59MHqVr6065930; Wed, 22 Oct 2025 17:52:31 GMT (envelope-from git) Date: Wed, 22 Oct 2025 17:52:31 GMT Message-Id: <202510221752.59MHqVr6065930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3d368c699b73 - stable/15 - libc: Add "Z" as TZ designator for strptime. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3d368c699b73cc1dff3ca27d29d19666741d9ff8 Auto-Submitted: auto-generated The branch stable/15 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3d368c699b73cc1dff3ca27d29d19666741d9ff8 commit 3d368c699b73cc1dff3ca27d29d19666741d9ff8 Author: Gordon Tetlow AuthorDate: 2025-10-15 22:24:06 +0000 Commit: Gordon Tetlow CommitDate: 2025-10-22 17:52:15 +0000 libc: Add "Z" as TZ designator for strptime. ISO 8601 allows use of "Z" as the time zone designator. Update the strptime parser to allow this usage. While we are at it, update the manpage to reflect that both UTC and Z are now valid options. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53083 (cherry picked from commit 79e57ea662d92ffcbe7d65854a284aefac6a332d) --- lib/libc/stdtime/strptime.3 | 2 +- lib/libc/stdtime/strptime.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index 7df73d2d080a..9456fa757b85 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -171,7 +171,7 @@ is taken as noon. The .Fa %Z format specifier only accepts time zone abbreviations of the local time zone, -or the value "GMT". +and the values "GMT", "UTC", or "Z". This limitation is because of ambiguity due to of the over loading of time zone abbreviations. One such example is diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 5f1293c7a267..375e49146639 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -546,7 +546,8 @@ label: zonestr[cp - buf] = '\0'; tzset(); if (0 == strcmp(zonestr, "GMT") || - 0 == strcmp(zonestr, "UTC")) { + 0 == strcmp(zonestr, "UTC") || + 0 == strcmp(zonestr, "Z")) { *GMTp = 1; } else if (0 == strcmp(zonestr, tzname[0])) { tm->tm_isdst = 0;