Bug 120735

Summary: Wrong keybinding for "&" with charset other than UTF-8
Product: [Fedora] Fedora Reporter: Leonard den Ottolander <leonard-rh-bugzilla>
Component: mcAssignee: Jindrich Novy <jnovy>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: pknirsch, zenczykowski
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.6.1-0.5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-23 14:48:44 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:

Description Leonard den Ottolander 2004-04-13 16:34:40 UTC
mc-4.6.0-8.4

When using another charset than UTF-8 (tried ISO-8859-1 and -15)
replacing " " with "&nbsp;" 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 15:49:22 UTC
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 17:41:10 UTC
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);