Bug 155974
Summary: | mc uses strange 'Other 8 bit' in the charset conversion | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Andy Shevchenko <andy> | ||||||
Component: | mc | Assignee: | Jindrich Novy <jnovy> | ||||||
Status: | CLOSED UPSTREAM | QA Contact: | |||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 3 | CC: | leonard-rh-bugzilla, pknirsch | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2005-05-18 10:39:46 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | 154516 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Andy Shevchenko
2005-04-26 12:26:57 UTC
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. |