From nobody@FreeBSD.org  Fri Jun  8 15:38:26 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0C2681065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  8 Jun 2012 15:38:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id EB5908FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  8 Jun 2012 15:38:25 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q58FcPcH079652
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 8 Jun 2012 15:38:25 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q58FcPgc079651;
	Fri, 8 Jun 2012 15:38:25 GMT
	(envelope-from nobody)
Message-Id: <201206081538.q58FcPgc079651@red.freebsd.org>
Date: Fri, 8 Jun 2012 15:38:25 GMT
From: Martin Nowak <dawg@dawgfoto.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] tzname set incorrectly
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168862
>Category:       bin
>Synopsis:       [tzcode] [patch] tzname set incorrectly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 08 15:40:14 UTC 2012
>Closed-Date:    
>Last-Modified:  Thu Apr 17 04:39:37 UTC 2014
>Originator:     Martin Nowak
>Release:        FreeBSD 9.0-STABLE amd64
>Organization:
>Environment:
FreeBSD dawg-FreeBSD.lan 9.0-STABLE FreeBSD 9.0-STABLE #67 r+c73a94d: Mon May 21 22:04:38 CEST 2012 root@dawg-FreeBSD.lan:/usr/obj/opt/src/sys/DAWG_P8H67M_EVO amd64
>Description:
tzname is not set to the latest zone name

http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/tzcode/stdtime/localtime.c.diff?r1=1.1;r2=1.2
>How-To-Repeat:
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
    setenv("TZ", "America/Los_Angeles", 1);
    tzset();
    // prints PPT instead of PDT
    printf("%s\n", tzname[1]);
    return 0;
}

>Fix:


Patch attached with submission follows:

diff --git a/contrib/tzcode/stdtime/localtime.c b/contrib/tzcode/stdtime/localtime.c
index 9605eeb..4b1a1ec 100644
--- a/contrib/tzcode/stdtime/localtime.c
+++ b/contrib/tzcode/stdtime/localtime.c
@@ -318,7 +318,7 @@ settzname(void)
 	/*
 	** And to get the latest zone names into tzname. . .
 	*/
-	for (i = 0; i < sp->typecnt; ++i) {
+	for (i = 0; i < sp->timecnt; ++i) {
 		const struct ttinfo * const ttisp = &sp->ttis[sp->types[i]];
 
 		tzname[ttisp->tt_isdst] =


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Mon Jul 9 00:22:35 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168862 
Responsible-Changed-From-To: eadler->freebsd-bugs 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Sep 2 17:06:42 UTC 2012 
Responsible-Changed-Why:  
I won't be looking at this PR for a while and I need to clear some out 
of my queue 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168862 
>Unformatted:
