From f81fa564683bc36daeef8d8afade952dcde84aab Mon Sep 17 00:00:00 2001 From: Debabrata Sengupta Date: Mon, 9 Jul 2012 18:25:45 +0000 Subject: [PATCH] ICU-8971 fixed parsing inconsistency and corrected few test cases X-SVN-Rev: 32031 --- icu4c/source/common/uloc.cpp | 4 ++-- icu4c/source/test/cintltst/cloctst.c | 12 ++++++------ icu4c/source/test/intltest/loctest.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 8cbf7a3f9c9..2f84aba5c48 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -1700,8 +1700,8 @@ _canonicalize(const char* localeID, len+=cntrySize; } if(_isIDSeparator(*tmpLocaleID)) { - /* If there is something else, then we add the _ if we found country before.*/ - if (cntrySize > 0 ) { + /* If there is something else, then we add the _ if we found country before. */ + if (cntrySize >= 0 && ! _isIDSeparator(*(tmpLocaleID+1)) ) { ++fieldCount; if(len