Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: source/i18n/uspoof_conf.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/uspoof_build.cpp ('k') | source/i18n/uspoof_impl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/uspoof_conf.cpp
diff --git a/source/i18n/uspoof_conf.cpp b/source/i18n/uspoof_conf.cpp
index 2b2db9fe661c2bad65101d41ece80029bcbf895f..bb380eae9bcc530942668823834f92c62906b05d 100644
--- a/source/i18n/uspoof_conf.cpp
+++ b/source/i18n/uspoof_conf.cpp
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 2008-2013, International Business Machines
+* Copyright (C) 2008-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -300,8 +300,31 @@ void ConfusabledataBuilder::build(const char * confusables, int32_t confusablesL
uregex_start(fParseLine, 5, &status) >= 0 ? fMLTable :
uregex_start(fParseLine, 6, &status) >= 0 ? fMATable :
NULL;
- U_ASSERT(table != NULL);
- uhash_iput(table, keyChar, smapString, &status);
+ if (U_SUCCESS(status) && table == NULL) {
+ status = U_PARSE_ERROR;
+ }
+ if (U_FAILURE(status)) {
+ return;
+ }
+
+ // For Unicode 8, the SL, SA and ML tables have been discontinued.
+ // All input data from confusables.txt is tagged MA.
+ // ICU spoof check functions should ignore the specified table and always
+ // use this MA Data.
+ // For now, implement by populating the MA data into all four tables, and
+ // keep the multiple table implementation in place, in case it comes back
+ // at some time in the future.
+ // There is no run time size penalty to keeping the four table implementation -
+ // the data is shared when it's the same betweeen tables.
+ if (table != fMATable) {
+ status = U_PARSE_ERROR;
+ return;
+ };
+ // uhash_iput(table, keyChar, smapString, &status);
+ uhash_iput(fSLTable, keyChar, smapString, &status);
+ uhash_iput(fSATable, keyChar, smapString, &status);
+ uhash_iput(fMLTable, keyChar, smapString, &status);
+ uhash_iput(fMATable, keyChar, smapString, &status);
fKeySet->add(keyChar);
if (U_FAILURE(status)) {
return;
« no previous file with comments | « source/i18n/uspoof_build.cpp ('k') | source/i18n/uspoof_impl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698