Bug 120735 - Wrong keybinding for "&" with charset other than UTF-8
Wrong keybinding for "&" with charset other than UTF-8
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-13 12:34 EDT by Leonard den Ottolander
Modified: 2013-07-02 18:59 EDT (History)
2 users (show)

See Also:
Fixed In Version: 4.6.1-0.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-23 10:48:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Leonard den Ottolander 2004-04-13 12:34:40 EDT
mc-4.6.0-8.4

When using another charset than UTF-8 (tried ISO-8859-1 and -15)
replacing " " with " " with the midnight commander editor (F4;
F4) "&" gets interpreted as a (multi) function key which makes it
impossible to complete the search and replace.
Comment 1 Leonard den Ottolander 2004-05-13 11:49:22 EDT
Thanks to Vladimir:

--- src/widget.c 
+++ src/widget.c 
@@ -220,7 +220,6 @@ 
        } else
 #endif
        {
-           *hotkeyp = tolower (*cp); 
+           *hotkeyp = tolower (*(cp+1)); 
            *hotposp = cp - text;
        }
-       strcpy (cp, cp+1);

Note that the strcpy originally comes before the tolower, thus
eliminating the need for the increment of 1. Very ugly!
Comment 2 Leonard den Ottolander 2004-05-13 13:41:10 EDT
Since the strcpy seems to have a function after all the patch should read:

--- mc-4.6.0/src/widget.c.000	2004-05-13 18:14:10.000000000 +0200
+++ mc-4.6.0/src/widget.c	2004-05-13 18:15:11.000000000 +0200
@@ -220,7 +220,7 @@
 	} else
 #endif
 	{
-	    *hotkeyp = tolower (*cp);
+	    *hotkeyp = tolower (*(cp+1));
 	    *hotposp = cp - text;
 	}
 	strcpy (cp, cp+1);

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