Fix a bug in which "16\d+6" matches 166 and the number is handled as Thailand one...
diff --git a/android/PhoneNumberUtils.cpp b/android/PhoneNumberUtils.cpp
index cb8552e..47dd279 100644
--- a/android/PhoneNumberUtils.cpp
+++ b/android/PhoneNumberUtils.cpp
@@ -201,6 +201,8 @@
*new_len = len - (i + 1);
}
return 66;
+ } else {
+ return -1;
}
break;
default:
diff --git a/android/PhoneNumberUtilsTest.cpp b/android/PhoneNumberUtilsTest.cpp
index 6772fe5..4dab98b 100644
--- a/android/PhoneNumberUtilsTest.cpp
+++ b/android/PhoneNumberUtilsTest.cpp
@@ -123,6 +123,7 @@
// Confirm that the bug found before does not re-appear.
EXPECT_NE("080-1234-5678", "+819012345678");
+ EXPECT_EQ("650-000-3456", "16500003456");
// Currently we cannot get this test through (Japanese trunk prefix is 0,
// but there is no sensible way to know it now (as of 2009-6-12)...