Mercurial > hg > octave-kai > gnulib-hg
changeset 3209:5416525015e5
(locale_charset): Allow wildcard syntax. Also resolve
alias if codeset is empty.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Thu, 15 Mar 2001 14:49:56 +0000 |
parents | 20fa6a98d9bf |
children | 2ac2d13235d8 |
files | lib/localcharset.c |
diffstat | 1 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -252,18 +252,17 @@ if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; - else if (codeset[0] != '\0') - { - /* Resolve alias. */ - for (aliases = get_charset_aliases (); - *aliases != '\0'; - aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) - if (!strcmp (codeset, aliases)) - { - codeset = aliases + strlen (aliases) + 1; - break; - } - } + + /* Resolve alias. */ + for (aliases = get_charset_aliases (); + *aliases != '\0'; + aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) + if (strcmp (codeset, aliases) == 0 + || (aliases[0] == '*' && aliases[1] == '\0')) + { + codeset = aliases + strlen (aliases) + 1; + break; + } return codeset; }