ICU-402 genrb now handles \u0000 again
X-SVN-Rev: 1420
This commit is contained in:
parent
1d3e8f643d
commit
b126b1ac93
@ -301,7 +301,7 @@ parse(FileStream *f, const char *cp,
|
||||
*status = U_INTERNAL_PROGRAM_ERROR;
|
||||
goto finish;
|
||||
}
|
||||
temp = string_open(bundle, cTag, token.fChars, status);
|
||||
temp = string_open(bundle, cTag, token.fChars, token.fLength, status);
|
||||
table_add(rootTable, temp, status);
|
||||
if(colEl == TRUE) {
|
||||
const UChar * defaultRulesArray;
|
||||
@ -348,7 +348,7 @@ parse(FileStream *f, const char *cp,
|
||||
goto finish;
|
||||
}
|
||||
temp = array_open(bundle, cTag, status);
|
||||
temp1 = string_open(bundle, NULL, token.fChars, status);
|
||||
temp1 = string_open(bundle, NULL, token.fChars, token.fLength, status);
|
||||
array_add(temp, temp1, status);
|
||||
temp1 = NULL;
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
@ -356,7 +356,7 @@ parse(FileStream *f, const char *cp,
|
||||
|
||||
/* Record a comma-delimited list string */
|
||||
case eListStr:
|
||||
temp1 = string_open(bundle, NULL, token.fChars, status);
|
||||
temp1 = string_open(bundle, NULL, token.fChars, token.fLength, status);
|
||||
array_add(temp, temp1, status);
|
||||
temp1 = NULL;
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
@ -392,7 +392,7 @@ parse(FileStream *f, const char *cp,
|
||||
break;
|
||||
|
||||
case e2dStr:
|
||||
temp2 = string_open(bundle, NULL, token.fChars, status);
|
||||
temp2 = string_open(bundle, NULL, token.fChars, token.fLength, status);
|
||||
array_add(temp1, temp2, status);
|
||||
temp2 = NULL;
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
@ -423,7 +423,7 @@ parse(FileStream *f, const char *cp,
|
||||
break;
|
||||
|
||||
case eTaggedStr:
|
||||
temp1 = string_open(bundle, cSubTag, token.fChars, status);
|
||||
temp1 = string_open(bundle, cSubTag, token.fChars, token.fLength, status);
|
||||
table_add(temp, temp1, status);
|
||||
temp1 = NULL;
|
||||
if(U_FAILURE(*status)) goto finish;
|
||||
|
@ -334,7 +334,7 @@ struct SResource* array_open(struct SRBRoot *bundle, char *tag, UErrorCode *stat
|
||||
return res;
|
||||
}
|
||||
|
||||
struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, UErrorCode *status) {
|
||||
struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, UErrorCode *status) {
|
||||
|
||||
struct SResource *res;
|
||||
|
||||
@ -359,15 +359,15 @@ struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, U
|
||||
|
||||
res->fNext = NULL;
|
||||
|
||||
res->u.fString.fLength = u_strlen(value);
|
||||
res->u.fString.fChars = (UChar *)uprv_malloc(sizeof(UChar) * (u_strlen(value)+1));
|
||||
res->u.fString.fLength = len;
|
||||
res->u.fString.fChars = (UChar *)uprv_malloc(sizeof(UChar) * (len+1));
|
||||
if(res->u.fString.fChars == NULL) {
|
||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
uprv_free(res);
|
||||
return NULL;
|
||||
}
|
||||
u_strcpy(res->u.fString.fChars, value);
|
||||
res->fSize = sizeof(int32_t) + sizeof(UChar) * (u_strlen(value)+1);
|
||||
uprv_memcpy(res->u.fString.fChars, value, sizeof(UChar) * (len+1));
|
||||
res->fSize = sizeof(int32_t) + sizeof(UChar) * (len+1);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ struct SResString {
|
||||
UChar *fChars;
|
||||
};
|
||||
|
||||
struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, UErrorCode *status);
|
||||
struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, UErrorCode *status);
|
||||
void string_close(struct SResource *string, UErrorCode *status);
|
||||
|
||||
struct SResIntVector {
|
||||
|
Loading…
Reference in New Issue
Block a user