about summary refs log tree commit diff
path: root/pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch
blob: d6d55a02707497242ad38bebb6a0a0d43db45850 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Submitted By: Alexander E. Patrakov
Date: 2007-01-19
Initial Package Version: 4.6.1
Origin: http://bugs.gentoo.org/show_bug.cgi?id=153925
Upstream Status: aware of the problem
Description: with bash-3.2, unpatched mc-4.6.1 refuses to go into directories
containing underscores or other strange characters.

--- mc-4.6.1/src/subshell.c.000	2006-05-08 23:11:48.000000000 +0200
+++ mc-4.6.1/src/subshell.c	2006-10-28 15:40:46.000000000 +0200
@@ -745,29 +745,13 @@ subshell_name_quote (const char *s)
     memcpy (d, cmd_start, len);
     d += len;
 
-    /*
-     * Print every character in octal format with the leading backslash.
-     * tcsh and zsh may require 4-digit octals, bash < 2.05b doesn't like them.
-     */
-    if (subshell_type == BASH) {
 	for (; *s; s++) {
-	    /* Must quote numbers, so that they are not glued to octals */
 	    if (isalpha ((unsigned char) *s)) {
 		*d++ = (unsigned char) *s;
 	    } else {
-		sprintf (d, "\\%03o", (unsigned char) *s);
-		d += 4;
-	    }
-	}
-    } else {
-	for (; *s; s++) {
-	    if (isalnum ((unsigned char) *s)) {
-		*d++ = (unsigned char) *s;
-	    } else {
 		sprintf (d, "\\0%03o", (unsigned char) *s);
 		d += 5;
 	    }
-	}
     }
 
     memcpy (d, common_end, sizeof (common_end));