Allow for NUL's.

[SVN r29513]
This commit is contained in:
John Maddock
2005-06-10 10:08:40 +00:00
parent 9e9fc27dc6
commit bbd5296b4e

View File

@ -37,11 +37,11 @@ icu_regex_traits_implementation::string_type icu_regex_traits_implementation::do
{
scoped_array< ::uint8_t> presult(new ::uint8_t[len+1]);
len = pcoll->getSortKey(&*t.begin(), static_cast< ::int32_t>(t.size()), presult.get(), len+1);
if(0 == presult[len-1])
if((0 == presult[len-1]) && (len > 1))
--len;
return string_type(presult.get(), presult.get()+len);
}
if(0 == result[len-1])
if((0 == result[len-1]) && (len > 1))
--len;
return string_type(result, result+len);
}