mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-2269 don't use aliasing ctor in uset_addString
X-SVN-Rev: 9817
This commit is contained in:
parent
f346c4d8f2
commit
cc4c361654
1 changed files with 9 additions and 1 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "unicode/uset.h"
|
||||
#include "unicode/uniset.h"
|
||||
#include "cmemory.h"
|
||||
#include "unicode/ustring.h"
|
||||
|
||||
U_CAPI USet* U_EXPORT2
|
||||
uset_open(UChar32 start, UChar32 end) {
|
||||
|
@ -72,7 +73,14 @@ uset_add(USet* set, UChar32 c) {
|
|||
|
||||
U_CAPI void U_EXPORT2
|
||||
uset_addString(USet* set, const UChar* str, int32_t strLen) {
|
||||
UnicodeString s(strLen==-1, str, strLen);
|
||||
// WRONG! Do not alias, it will stay aliased, even after
|
||||
// copying. TODO: do we need a copy ctor that unaliases
|
||||
//UnicodeString s(strLen==-1, str, strLen);
|
||||
// We promised -1 for zero terminated
|
||||
if(strLen == -1) {
|
||||
strLen = u_strlen(str);
|
||||
}
|
||||
UnicodeString s(str, strLen);
|
||||
((UnicodeSet*) set)->add(s);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue