copy_current_pathname()



Hello,
when copying current pathname containing characters like 
[\'\\\n\t\r":; ] (and many others---for a full list see `util.c', 
name_quote()) on the MC's command line, the function name_quote() 
is not used. Is this intentional? If not, the patch for 
MC 4.6.0-pre1 is attached.

I've basically lifted it from copy_prog_name() in `main.c'.
 
On another note, for those who remember the recent thread "Keyboard
configurability", unfortunately, multiple escape sequences for the
same keys in `~/.mc/ini' in section [terminal:XXX] didn't work for me. I
had to hardcode them in the source. This is, of course, a temporary 
workaround. When I have more time, I'll try to find out why it 
didn't work.

Regards,

Jiri

PS: Trying to be responsible ;)
--- main.c.orig	Wed Aug 21 02:08:49 2002
+++ main.c	Fri Oct  4 13:21:30 2002
@@ -1258,12 +1258,16 @@
 
 static void copy_current_pathname (void)
 {
+    char *tmp;
     if (!command_prompt)
 	return;
 
-    stuff (input_w (cmdline), cpanel->cwd, 0);
-    if (cpanel->cwd [strlen (cpanel->cwd) - 1] != PATH_SEP)
+    tmp = name_quote (cpanel->cwd, 1);
+    stuff (input_w (cmdline), tmp, 0);
+    g_free (tmp);
+    if (cpanel->cwd [strlen (cpanel->cwd) - 1] != PATH_SEP) {
         stuff (input_w (cmdline), PATH_SEP_STR, 0);
+    }
 }
 
 static void copy_other_pathname (void)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]