mirror of https://gitee.com/bigwinds/arangodb
bugfix
This commit is contained in:
parent
aed99d178d
commit
129d6d33eb
|
@ -284,10 +284,11 @@ char* Utf8Helper::tolower (TRI_memory_zone_t* zone, const char *src, int32_t src
|
||||||
&status);
|
&status);
|
||||||
|
|
||||||
if (status == U_BUFFER_OVERFLOW_ERROR) {
|
if (status == U_BUFFER_OVERFLOW_ERROR) {
|
||||||
TRI_Free(zone, utf8_dest);
|
status = U_ZERO_ERROR;
|
||||||
utf8_dest = (char*) TRI_Allocate(zone, (dstLength+1) * sizeof(char), false);
|
TRI_Free(zone, utf8_dest);
|
||||||
|
utf8_dest = (char*) TRI_Allocate(zone, (dstLength + 1) * sizeof(char), false);
|
||||||
|
|
||||||
dstLength = ucasemap_utf8ToLower(csm.getAlias(),
|
dstLength = ucasemap_utf8ToLower(csm.getAlias(),
|
||||||
utf8_dest,
|
utf8_dest,
|
||||||
dstLength + 1,
|
dstLength + 1,
|
||||||
src,
|
src,
|
||||||
|
@ -358,13 +359,13 @@ char* Utf8Helper::toupper (TRI_memory_zone_t* zone, const char *src, int32_t src
|
||||||
&status);
|
&status);
|
||||||
|
|
||||||
if (status == U_BUFFER_OVERFLOW_ERROR) {
|
if (status == U_BUFFER_OVERFLOW_ERROR) {
|
||||||
TRI_Free(zone, utf8_dest);
|
status = U_ZERO_ERROR;
|
||||||
dstLength = dstLength+1;
|
TRI_Free(zone, utf8_dest);
|
||||||
utf8_dest = (char*) TRI_Allocate(zone, dstLength * sizeof(char), false);
|
utf8_dest = (char*) TRI_Allocate(zone, (dstLength + 1) * sizeof(char), false);
|
||||||
|
|
||||||
dstLength = ucasemap_utf8ToUpper(csm.getAlias(),
|
dstLength = ucasemap_utf8ToUpper(csm.getAlias(),
|
||||||
utf8_dest,
|
utf8_dest,
|
||||||
dstLength,
|
dstLength + 1,
|
||||||
src,
|
src,
|
||||||
srcLength,
|
srcLength,
|
||||||
&status);
|
&status);
|
||||||
|
@ -380,7 +381,7 @@ char* Utf8Helper::toupper (TRI_memory_zone_t* zone, const char *src, int32_t src
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
utf8_dest = TRI_LowerAsciiStringZ(zone, src);
|
utf8_dest = TRI_UpperAsciiStringZ(zone, src);
|
||||||
dstLength = strlen(utf8_dest);
|
dstLength = strlen(utf8_dest);
|
||||||
return utf8_dest;
|
return utf8_dest;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue