nixpkgs/pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch
Sander van der Burg 3e69dab469 Applied some fixes to midnight commander so that it no longer displays weird characters
svn path=/nixpkgs/trunk/; revision=17207
2009-09-16 17:08:33 +00:00

41 lines
1.2 KiB
Diff

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));