Re: [bug #18136] MC wont work with new bash-3.2 propeply with all directories.



Hi,

On Sat, 2006-10-28 at 15:30 +0200, Leonard den Ottolander wrote:
> Anyway, instead of testing for bash >= 3.2 inside the bash loop we can
> suffice by adding a version check for bash < 2.05b to the shell type
> test.

A quick and dirty hack for users of bash >= 3.2 would be to just get rid
of the subshell_type == BASH test and block, and use the default block. 

If we only escape alphas and not numbers in the default block this hack
should be safe for all users of bash > 2.05b as explained in the
previous mail.

Attached patch implements this. This is not a proposition for a final
solution, just a temporary hack for users of bash >= 3.2.

Do not use with versions of bash <= 2.05b!

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

--- subshell.c.000	2006-05-08 23:11:48.000000000 +0200
+++ 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));


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