summaryrefslogtreecommitdiffstats
path: root/usr.bin/mklocale
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2003-06-02 19:54:29 +0000
committerache <ache@FreeBSD.org>2003-06-02 19:54:29 +0000
commit7b3c2b7e5fb6e8538bf222b5ef3d74fd3a8b7950 (patch)
tree8fb2e7f83f8b73d66b727473407d5c3aec11ee23 /usr.bin/mklocale
parent08edb6719701bc78733831e0703323f2dda158c4 (diff)
downloadFreeBSD-src-7b3c2b7e5fb6e8538bf222b5ef3d74fd3a8b7950.zip
FreeBSD-src-7b3c2b7e5fb6e8538bf222b5ef3d74fd3a8b7950.tar.gz
Hardcore supported encodings list
Diffstat (limited to 'usr.bin/mklocale')
-rw-r--r--usr.bin/mklocale/yacc.y12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y
index 9709400..14a0ba1 100644
--- a/usr.bin/mklocale/yacc.y
+++ b/usr.bin/mklocale/yacc.y
@@ -116,7 +116,17 @@ table : entry
;
entry : ENCODING STRING
- { strncpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); }
+ { if (strcmp($2, "NONE") &&
+ strcmp($2, "UTF2") &&
+ strcmp($2, "UTF-8") &&
+ strcmp($2, "EUC") &&
+ strcmp($2, "GBK") &&
+ strcmp($2, "BIG5") &&
+ strcmp($2, "MSKanji")) {
+ fprintf(stderr, "ENCODING %s is not supported by libc\n", $2);
+ exit(1);
+ }
+ strncpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); }
| VARIABLE
{ new_locale.variable_len = strlen($1) + 1;
new_locale.variable = malloc(new_locale.variable_len);
OpenPOWER on IntegriCloud