Bug 169531 - Some patches need to be corrected
Some patches need to be corrected
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
4
All Linux
medium Severity low
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-29 09:14 EDT by Victor Abramoff
Modified: 2013-07-02 19:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-29 13:55:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Victor Abramoff 2005-09-29 09:14:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ru-RU; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

Description of problem:
Patches strangeness: mc-utf8.patch change from 'strlen' to 'mbstrlen', then mc-find.patch do the contrary.

Hunk from mc-utf8.patch:

@@ -223,8 +223,8 @@ find_parameters (char **start_dir, char
        ilen = FIND_X - 7 - maxlen;     /* for the case of very long buttons :)
*/
        istart = FIND_X - 3 - ilen;

-       b1 = b0 + strlen (buts[0]) + 7;
-       b2 = FIND_X - (strlen (buts[2]) + 6);
+       b1 = b0 + mbstrlen (buts[0]) + 7;
+       b2 = FIND_X - (mbstrlen (buts[2]) + 6);

        i18n_flag = 1;
        case_label = _(case_label);


Hunk from mc-find.patch:

@@ -223,11 +235,12 @@
        ilen = FIND_X - 7 - maxlen;     /* for the case of very long buttons :)
*/
        istart = FIND_X - 3 - ilen;

-       b1 = b0 + mbstrlen (buts[0]) + 7;
-       b2 = FIND_X - (mbstrlen (buts[2]) + 6);
+       b1 = b0 + strlen (buts[0]) + 7;
+       b2 = FIND_X - (strlen (buts[2]) + 6);

        i18n_flag = 1;
        case_label = _(case_label);
+       recurs_label = _(recurs_label);
     }
 #endif                         /* ENABLE_NLS */

Also, I offer addition to gcc4 patch:

diff -uNr mc-4.6.1.gcc4/src/widget.c mc-4.6.1/src/widget.c
--- mc-4.6.1.gcc4/src/widget.c  Fri May 27 18:19:19 2005
+++ mc-4.6.1/src/widget.c       Thu Sep 29 15:59:58 2005
@@ -1165,7 +1165,7 @@
 static void
 forward_word (WInput *in)
 {
-    unsigned char *p = in->buffer+in->point;
+    char *p = in->buffer+in->point;

     while (*p && (isspace (*p) || ispunct (*p)))
        p++;
@@ -1177,7 +1177,7 @@
 static void
 backward_word (WInput *in)
 {
-    unsigned char *p = in->buffer+in->point;
+    char *p = in->buffer+in->point;

     while (p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1))))
        p--;


Version-Release number of selected component (if applicable):
mc-4.6.1a-0.12.FC4

How reproducible:
Always

Steps to Reproduce:
none

Additional info:
Comment 1 Jindrich Novy 2005-09-29 13:55:26 EDT
Yes, the mc-find patch need to be fixed to mbstrlen to correctly support UTF-8.

I noticed yet another thing:
list->list[next_free].fnamelen = strlen (name);

what I converted to mbstrlen() as well. A similar problem was in cstrcasestr().

Sorry, I didn't add the signedness fixes as they're unimportant from
functionality point of view.

Note You need to log in before you can comment on or make changes to this bug.