diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-06-02 19:54:29 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-06-02 19:54:29 +0000 |
| commit | 92b49d4efa958651dad9616ec90d2f971c6b389f (patch) | |
| tree | 8fb2e7f83f8b73d66b727473407d5c3aec11ee23 | |
| parent | 06a31d6a6779b74405b41c8ad4579b5d81db4d4c (diff) | |
Notes
| -rw-r--r-- | usr.bin/mklocale/yacc.y | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y index 9709400f3b8c..14a0ba10713b 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); |
