Description of problem: mc uses strange item 'Other 8 bit' in charset chooser. I resolved the problem by changing that item to native current charmap (got by nl_langinfo(CODESET)). In addition we do not need to choose charmap after first start of mc. This bug is correlated with Andrew's patch from bug #154516. Version-Release number of selected component (if applicable): Last official FC3 update (and may be current)
Created attachment 113664 [details] Patch for using current charmap instead of 'Other 8 bit'
Hello Andy, +static const char * +get_current_charmap (void) +{ + int init = -1; + static char *charmap = NULL; + + if (init == -1) { + char *lc_ctype = setlocale (LC_CTYPE, ""); + charmap = nl_langinfo (CODESET); + setlocale (LC_CTYPE, lc_ctype); + init = 0; + } + return charmap; +} Doesn't the init variable miss the static storage class? The condition will be executed every time when get_current_charmap() is called what is likely not intended. Also #include <langinfo.h> seems to be missing.
Hi, Jindrich. 1. Yes, I missed 2. Also, yes. Thanks for reviewing code.
2. Sorry, I am wrong. The langinfo.h already added.
Created attachment 113710 [details] New version of patch Fix non-static class of init variable. Also fix potential segfault in the strcasecmp().
Andy, the patch looks much better now but the only thing I'm afraid of is broken translations of the "Current charmap" instead of "Other 8 bit". Maybe it's a good thing if you send this patch to upstream so that people will take care about translating the message when the patch is commmitted there. Also it's not very usual that you put credits directly to the source code. If you don't have any objections I credit authors of the patches in the spec file instead of the source directly as I did in Andrew's case for instance.
Ok, I try to some change patch (instead of -> with) and send to upstream it. Yes, I agree with you. This patch injects minor function and no needs credit.
Andy, thanks for the patch anyway. I'll close this bug UPSTREAM whenever I see mail from you on mc-devel.
Hi, Jindrich! I've put message to mc-devel@ list today. You can close bug. P.S> However, I should like to make this patch more convenient.
Hello Andy! Thanks! I'll try to discuss it on upstream list when needed and keep track of it.