ICU-978 make genUCA process both DOS and UNIX files

X-SVN-Rev: 9262
This commit is contained in:
Vladimir Weinstein 2002-07-19 21:59:26 +00:00
parent 6be11f8432
commit 10e780fc17

View file

@ -348,6 +348,7 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
char *endCodePoint = NULL;
char *spacePointer = NULL;
char *result = fgets(buffer, 2048, data);
int32_t buflen = uprv_strlen(buffer);
if(U_FAILURE(*status)) {
return 0;
}
@ -361,7 +362,11 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
return NULL;
}
}
if(buffer[0] == '#' || buffer[0] == '\n') {
while(buflen>0 && (buffer[buflen-1] == '\r' || buffer[buflen-1] == '\n')) {
buffer[--buflen] = 0;
}
if(buffer[0] == 0 || buffer[0] == '#') {
return NULL; // just a comment, skip whole line
}
@ -520,7 +525,7 @@ UCAElements *readAnElement(FILE *data, tempUCATable *t, UCAConstants *consts, UE
commentStart = strchr(startCodePoint, '#');
if(commentStart == NULL) {
commentStart = strlen(startCodePoint) + startCodePoint - 1;
commentStart = strlen(startCodePoint) + startCodePoint;
}
i = 0;