Bug 464708

Summary: midnight commander: minor bugs in utf-8 patches
Product: [Fedora] Fedora Reporter: Rafał Mużyło <galtgendo>
Component: mcAssignee: Jindrich Novy <jnovy>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: dvlasenk, galtgendo, jnovy, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.6.2-4.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-02 14:16:25 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:
Attachments:
Description Flags
diff between your patch and the one I'm using
none
the full diff none

Description Rafał Mużyło 2008-09-29 23:39:22 UTC
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;
 }
in src/view.c
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 <jnovy> 4.6.2-6.pre1

Comment 1 Bug Zapper 2008-11-26 03:16:42 UTC
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:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Rafał Mużyło 2008-12-02 22:21:08 UTC
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 
is upstream.

Comment 3 Jindrich Novy 2008-12-03 14:08:33 UTC
Hi Rafał,

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.

Comment 4 Rafał Mużyło 2008-12-03 16:07:50 UTC
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.

Comment 5 Jindrich Novy 2008-12-04 14:17:49 UTC
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!

Comment 6 Rafał Mużyło 2008-12-09 02:43:48 UTC
There's still problem 4.
Did you have a chance to fix it ?

Comment 7 Fedora Update System 2009-06-01 10:55:56 UTC
mc-4.6.2-4.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/mc-4.6.2-4.fc9

Comment 8 Fedora Update System 2009-06-02 14:15:57 UTC
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.