From a9b26a447d688884a4bf5ed091e46470ed250f70 Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Thu, 21 Feb 2019 23:17:37 -0800 Subject: [PATCH] ICU-20441 fix uninitialized fHasHanYearChar --- icu4c/source/i18n/smpdtfmt.cpp | 1 + icu4c/source/test/intltest/dtifmtts.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index 414dfffab8f..9ab765791fb 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -4217,6 +4217,7 @@ SimpleDateFormat::tzFormat(UErrorCode &status) const { void SimpleDateFormat::parsePattern() { fHasMinute = FALSE; fHasSecond = FALSE; + fHasHanYearChar = FALSE; int len = fPattern.length(); UBool inQuote = FALSE; diff --git a/icu4c/source/test/intltest/dtifmtts.cpp b/icu4c/source/test/intltest/dtifmtts.cpp index 4b38a3dc60e..44bfcdddfc6 100644 --- a/icu4c/source/test/intltest/dtifmtts.cpp +++ b/icu4c/source/test/intltest/dtifmtts.cpp @@ -1064,7 +1064,7 @@ void DateIntervalFormatTest::testFormat() { "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GyMMMd", "\\u662D\\u548C64\\u5E741\\u67085\\u65E5\\uFF5E\\u5E73\\u6210\\u5143\\u5E741\\u670815\\u65E5", - "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GGGGGyMd", "S64/1/5\\uFF5EH\\u5143/1/15", // The GGGGG/G forces inheritance from a different pattern, no padding + "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GGGGGyMd", "S64/1/5\\uFF5EH1/1/15", // The GGGGG/G forces inheritance from a different pattern, no padding "ja-u-ca-japanese", "H 31 04 15 09:00:00", JP_ERA_2019_NARROW " 1 05 15 09:00:00", "GGGGGyMd", "H31/4/15\\uFF5E" JP_ERA_2019_NARROW "1/5/15", -- 2.40.0