From 43fcd82d6e008b009ba0dc3e78aad099266fefba Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 24 Nov 2023 14:04:21 -0800
Subject: [PATCH 2/2] Simplify tzparse

* localtime.c (tzparse): Simplify by replacing three conditional
zero-initializations by a single one.
---
 localtime.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/localtime.c b/localtime.c
index 9bb4b2bf..f65a4295 100644
--- a/localtime.c
+++ b/localtime.c
@@ -1163,7 +1163,6 @@ tzparse(const char *name, struct state *sp, struct state const *basep)
 			*/
 			init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
 			init_ttinfo(&sp->ttis[1], -dstoffset, true, stdlen + 1);
-			sp->defaulttype = 0;
 			timecnt = 0;
 			janfirst = 0;
 			yearbeg = EPOCH_YEAR;
@@ -1323,15 +1322,14 @@ tzparse(const char *name, struct state *sp, struct state const *basep)
 			init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
 			init_ttinfo(&sp->ttis[1], -dstoffset, true, stdlen + 1);
 			sp->typecnt = 2;
-			sp->defaulttype = 0;
 		}
 	} else {
 		dstlen = 0;
 		sp->typecnt = 1;		/* only standard time */
 		sp->timecnt = 0;
 		init_ttinfo(&sp->ttis[0], -stdoffset, false, 0);
-		sp->defaulttype = 0;
 	}
+	sp->defaulttype = 0;
 	sp->charcnt = charcnt;
 	cp = sp->chars;
 	memcpy(cp, stdname, stdlen);
-- 
2.40.1

