Red Hat Bugzilla – Bug 464708
midnight commander: minor bugs in utf-8 patches
Last modified: 2013-07-02 19:32:09 EDT
I hope this bug won't get closed due to some minor technical detail, cause it's fully valid.
First of all, I'm a gentoo user.
Gentoo uses Debian patches, but they didn't really work for me,
so I decided to give yours a try.
They work in most cases, but there are still minor problems.
There are 4 problems I can recall, first three are double-width char related,
fourth - I'm not sure.
1. in the viewer: tested on kana/kanji, but probably valid for all double width;
Text is not displayed correctly, hard to explain, you'd have to see it for yourself. The fix was actually in your patches at some point, but then it disappeared. It was the following block:
int cw = wcwidth(wc);
if (cw > 1)
col+= cw - 1;
2. when a double-width char is entered in one of the standard input boxes,
a dot is added beyond the end of input, the dot is removed, if the char is removed
3. when a double-width char is entered in one of the password input boxes,
two stars appear instead of one
I found a fix that works for me for both of this cases, though I'm not sure if it's fully correct
Check my comments in Gentoo bug 237195.
4. this is one hard to noticed and I'm not sure whether it's double-width related or is a problem of utf8 string length in bytes vs the same in chars;
when the path shown over panels is very long it get truncated (that the expected behavior), but I've seen it getting truncated in the middle of utf8 char, meaning instead of the chars, hex sequences in brackets are printed;
I'm not sure if this can only be observed with double-width chars
(maybe it's some bizarre mix of bytes/string char count/string width)
The patches I use came from an rpm with last changelog entry in spec file:
Tue Sep 2 2008 Jindrich Novy <email@example.com> 4.6.2-6.pre1
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.
More information and reason for this action is here:
Created attachment 325437 [details]
diff between your patch and the one I'm using
This is the diff between your base utf8 patch
and the one with all 3 mentioned changes.
BTW, it seems that mc is almost as dead here,
as it's in Gentoo. Hopefully, not as dead as it
thanks for the patch. I see it is truncated? At least the last hunk is malformed. Please readd the correct one and I will happily apply it as soon as I test it.
Created attachment 325551 [details]
the full diff
Well, that's cause it's edited a bit.
This is the full diff.
The previous one had the last block partially removed,
as it's not relevant to this problem (and I can't really
tell anymore, why does it exist in the first place
- maybe I accidentally combined two of your patches ?).
My hacks are those 2 one line changes, the 4 line block
comes from some older patch.
Ok, it is unapplicable anyway ;) But it was enough to understand your changes. I modified your implementation to match mc coding style and simplified it a bit. It is now applied, thanks for the patch!
There's still problem 4.
Did you have a chance to fix it ?
mc-4.6.2-4.fc9 has been submitted as an update for Fedora 9.
mc-4.6.2-4.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.