ICU-2593 Just make sure that the aliases don't have options because they aren't needed.

There isn't a need to verify the converter name because we may want to unlist a converter without an option.

X-SVN-Rev: 11148
This commit is contained in:
George Rhoten 2003-02-25 01:58:57 +00:00
parent 67725ff09d
commit 0e62580a4a

View File

@ -622,7 +622,7 @@ addToKnownAliases(const char *alias) {
}
/*
@param When standard is 0, then it's the default tag.
@param standard When standard is 0, then it's the "empty" tag.
*/
static uint16_t
addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool defaultName) {
@ -652,6 +652,23 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default
exit(U_BUFFER_OVERFLOW_ERROR);
}
/* Show this warning only once. All aliases are added to the "ALL" tag. */
if (standard == ALL_TAG_NUM && GET_ALIAS_STR(converters[converter].converter) != alias) {
/* Normally these option values are parsed at runtime, and they can
be discarded when the alias is a default converter. Options should
only be on a converter and not an alias. */
if (uprv_strchr(alias, UCNV_OPTION_SEP_CHAR) != 0)
{
fprintf(stderr, "warning(line %d): alias %s contains a \""UCNV_OPTION_SEP_STRING"\". Options are parsed at run-time and do not need to be in the alias table.\n",
lineNum, alias);
}
if (uprv_strchr(alias, UCNV_VALUE_SEP_CHAR) != 0)
{
fprintf(stderr, "warning(line %d): alias %s contains an \""UCNV_VALUE_SEP_STRING"\". Options are parsed at run-time and do not need to be in the alias table.\n",
lineNum, alias);
}
}
/* Check for duplicates in a tag/converter combination */
for (idx = 0; idx < aliasList->aliasCount; idx++) {
uint16_t aliasNum = tags[standard].aliasList[converter].aliases[idx];