version 1.9, 2003/07/02 01:57:15 |
version 1.10, 2004/12/01 16:41:07 |
|
|
lineptr += len + 1; |
lineptr += len + 1; |
if (!strlen(lineptr)) { |
if (!strlen(lineptr)) { |
readerror(linenum); |
readerror(linenum); |
|
free(prefixtable[prefixcount].prefixname); |
continue; |
continue; |
} |
} |
lineptr += strspn(lineptr, " \n\t"); |
lineptr += strspn(lineptr, " \n\t"); |
|
|
lineptr += strspn(lineptr, " \n\t"); |
lineptr += strspn(lineptr, " \n\t"); |
if (!strlen(lineptr)) { |
if (!strlen(lineptr)) { |
readerror(linenum); |
readerror(linenum); |
|
free(unittable[unitcount].uname); |
continue; |
continue; |
} |
} |
len = strcspn(lineptr, "\n\t"); |
len = strcspn(lineptr, "\n\t"); |
|
|
num = atof(item); |
num = atof(item); |
if (!num) { |
if (!num) { |
zeroerror(); |
zeroerror(); |
|
free(savescr); |
return 1; |
return 1; |
} |
} |
if (doingtop ^ flip) |
if (doingtop ^ flip) |
|
|
num = atof(divider + 1); |
num = atof(divider + 1); |
if (!num) { |
if (!num) { |
zeroerror(); |
zeroerror(); |
|
free(savescr); |
return 1; |
return 1; |
} |
} |
if (doingtop ^ flip) |
if (doingtop ^ flip) |
|
|
num = atof(item); |
num = atof(item); |
if (!num) { |
if (!num) { |
zeroerror(); |
zeroerror(); |
|
free(savescr); |
return 1; |
return 1; |
} |
} |
if (doingtop ^ flip) |
if (doingtop ^ flip) |
|
|
item[strlen(item) - 1] = 0; |
item[strlen(item) - 1] = 0; |
} |
} |
for (; repeat; repeat--) |
for (; repeat; repeat--) |
if (addsubunit(doingtop ^ flip ? theunit->numerator : theunit->denominator, item)) |
if (addsubunit(doingtop ^ flip |
|
? theunit->numerator |
|
: theunit->denominator, item)) { |
|
free(savescr); |
return 1; |
return 1; |
|
} |
} |
} |
item = strtok(NULL, " *\t/\n"); |
item = strtok(NULL, " *\t/\n"); |
} |
} |