- else
- {
-
- int32_t count = (int32_t)uprv_strlen(filename);
-
- if (state->inputdir[state->inputdirLength - 1] != U_FILE_SEP_CHAR)
- {
- fullname = (char *) uprv_malloc(state->inputdirLength + count + 2);
-
- /* test for NULL */
- if(fullname == NULL)
- {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return NULL;
- }
-
- uprv_strcpy(fullname, state->inputdir);
-
- fullname[state->inputdirLength] = U_FILE_SEP_CHAR;
- fullname[state->inputdirLength + 1] = '\0';
-
- uprv_strcat(fullname, filename);
- }
- else
- {
- fullname = (char *) uprv_malloc(state->inputdirLength + count + 1);
-
- /* test for NULL */
- if(fullname == NULL)
- {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return NULL;
- }
-
- uprv_strcpy(fullname, state->inputdir);
- uprv_strcat(fullname, filename);
- }
-
- file = T_FileStream_open(fullname, "rb");
-
+ fullname.appendPathPart(filename.getAlias(), *status);
+ if (U_FAILURE(*status)) {
+ return NULL;