diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-02 12:28:28 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-02 12:28:28 +0000 |
commit | 7cf18ceb88384e0d01be3da5c7fe35fdc0806415 (patch) | |
tree | 41c7927648318aa63bccda158075ce74832853a9 /usr.bin/locale | |
parent | 9b60f79d2a35287b447a18ea50b1619cac524072 (diff) | |
download | src-test2-7cf18ceb88384e0d01be3da5c7fe35fdc0806415.tar.gz src-test2-7cf18ceb88384e0d01be3da5c7fe35fdc0806415.zip |
Notes
Diffstat (limited to 'usr.bin/locale')
-rw-r--r-- | usr.bin/locale/locale.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/locale/locale.c b/usr.bin/locale/locale.c index 9a1e437e0789..c07d7ca9b1cc 100644 --- a/usr.bin/locale/locale.c +++ b/usr.bin/locale/locale.c @@ -208,6 +208,9 @@ struct _kwinfo { }; #define NKWINFO (sizeof(kwinfo)/sizeof(kwinfo[0])) +const char *boguslocales[] = { "UTF-8", "la_LN." }; +#define NBOGUS (sizeof(boguslocales)/sizeof(boguslocales[0])) + int main(int argc, char *argv[]) { @@ -373,6 +376,8 @@ init_locales_list(void) { DIR *dirp; struct dirent *dp; + size_t i; + int bogus; /* why call this function twice ? */ if (locales != NULL) @@ -396,7 +401,12 @@ init_locales_list(void) while ((dp = readdir(dirp)) != NULL) { if (*(dp->d_name) == '.') continue; /* exclude "." and ".." */ - sl_add(locales, strdup(dp->d_name)); + for (bogus = i = 0; i < NBOGUS; i++) + if (strncmp(dp->d_name, boguslocales[i], + strlen(boguslocales[i])) == 0) + bogus = 1; + if (!bogus) + sl_add(locales, strdup(dp->d_name)); } closedir(dirp); |