pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bash 3.2 , echo -e and mc (error warning cannot change directory)
hello ,
few days ago i rebuild and reinstalled all pkgsrc packages (cvs from a
week ago)
but
every now and then i got errors from MC ( midnight commander)
when trying to change to a directory ( mostly when the directory
contained '-' '_' and such other characters )
after a little google search i found that there used to be a problem
with the combination of
bash-3.2 ( installed on my system)
echo built in command
mc-4.6.1 (installed , way of managing directory names )
particularly echo changed behavior for echo -e '\nnn'
it seems that :
Bash 3.1 says: \num the character whose ASCII code is NUM (octal)
Bash 3.2 says: \0nnn the character whose ASCII code is NNN (octal).
NNN can be 0 to 3 octal digits
so mc gets choked ,
after a little more search found a patch to fix this (attached)
i tried it for a few hours and it works
could someone have a look on it and if it's ok apply it ?
stefano
references :
http://www.mail-archive.com/bug-bash%gnu.org@localhost/msg02150.html
http://bugs.gentoo.org/show_bug.cgi?id=153925
http://bugs.gentoo.org/attachment.cgi?id=101796&action=view
--- subshell.c.orig 2005-06-07 12:19:19.000000000 +0300
+++ subshell.c 2007-12-21 13:08:23.000000000 +0200
@@ -718,29 +718,13 @@
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));
Home |
Main Index |
Thread Index |
Old Index