Imported Upstream version 4.2.1.36

Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
This commit is contained in:
Xamarin Public Jenkins
2015-09-24 06:06:07 -04:00
committed by Jo Shields
parent afe402035c
commit ea5caba957
172 changed files with 6570 additions and 11015 deletions

View File

@ -816,8 +816,15 @@ namespace System.Globalization
CultureInfo ci = new CultureInfo ();
if (!ci.construct_internal_locale_from_name (name)) {
int idx = name.IndexOf ('-');
if (idx < 1 || !ci.construct_internal_locale_from_name (name.Substring (0, idx)))
int idx = name.Length - 1;
if (idx > 0) {
while ((idx = name.LastIndexOf ('-', idx - 1)) > 0) {
if (ci.construct_internal_locale_from_name (name.Substring (0, idx)))
break;
}
}
if (idx <= 0)
throw CreateNotFoundException (src_name);
}