包名: zhcon<br>版本号: 1:0.2.6-10<br>维护人员: Aron Xu<br>Bug: zhcon可执行文件启动失败。<br>项目: http://anonscm.debian.org/cgit/chinese/zhcon.git/<br>有bug的补丁: http://anonscm.debian.org/cgit/chinese/zhcon.git/commit/?id=c3237304f3dcfee82ccb44e18b015633a03f724e<br><br><br>Bug描述:<br>"0008-default-to-utf8.patch"补丁有bug,导致zhcon启动失败。请移除这个补丁.<br><br>Technical infomation:<br>维护人员Aron Xu误解了getopt_long函数的用法,导到如下代码<br><br>static struct option long_options[] = {<br>  { "help",    0, NULL, 'h' },<br>  { "version",    0, NULL, 'V' },<br>  { "utf8",    0, NULL, 1 },<br>  { "drv",    1, NULL, 0 },<br>  { NULL,    0, NULL, 0 }<br>};<br><br>造成在使用--utf8命令行参数的时候,getopt_long返回1,结果switch-case运行到了default标签中,并导致程序异常退出。<br><br>如果你不加上--utf8命令行参数,那么第247行的代码<br><br>if (strcmp (long_options[option_index].name, "utf8") == 0)<br><br>导致程序不能运行到if语句块中,结果导致没法设置UTF-8的locale。<span id="_editor_bookmark_start_0" style="display: none; line-height: 0px;">‍</span><br>