Index: third_party/libaddressinput/chromium/cpp/src/rule.cc |
diff --git a/third_party/libaddressinput/chromium/cpp/src/rule.cc b/third_party/libaddressinput/chromium/cpp/src/rule.cc |
index 791ac9eca651bbba4d68945ffad93ffaafe454c4..1cc28f29a1af5ff5842fe266f485521cbb77c327 100644 |
--- a/third_party/libaddressinput/chromium/cpp/src/rule.cc |
+++ b/third_party/libaddressinput/chromium/cpp/src/rule.cc |
@@ -376,6 +376,7 @@ int Rule::GetInvalidFieldMessageId(AddressField field) const { |
} |
bool Rule::CanonicalizeSubKey(const std::string& user_input, |
+ bool canonicalize_latin_name, |
std::string* sub_key) const { |
if (sub_keys_.empty()) { |
*sub_key = user_input; |
@@ -384,7 +385,8 @@ bool Rule::CanonicalizeSubKey(const std::string& user_input, |
return GetMatchingSubKey(user_input, sub_keys_, sub_key) || |
GetMatchingSubKey(user_input, sub_names_, sub_key) || |
- GetMatchingSubKey(user_input, sub_lnames_, sub_key); |
+ GetMatchingSubKey(user_input, sub_lnames_, |
+ canonicalize_latin_name ? sub_key : NULL); |
} |
bool Rule::GetMatchingSubKey(const std::string& target, |
@@ -392,7 +394,9 @@ bool Rule::GetMatchingSubKey(const std::string& target, |
std::string* sub_key) const { |
for (size_t i = 0; i < values.size(); ++i) { |
if (LooseStringCompare(values[i], target)) { |
- *sub_key = sub_keys_[i]; |
+ if (sub_key != NULL) { |
+ *sub_key = sub_keys_[i]; |
+ } |
return true; |
} |
} |