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

2006-11-01 Thread Pavel Tsekov
On Tue, 31 Oct 2006, Leonard den Ottolander wrote:

 On Mon, 2006-10-30 at 11:45 +0200, Pavel Tsekov wrote:
 IMO, if you intend to work on a fix you should follow the
 suggestion of the bash maintainer to switch over to using
 printf - not only for bash but for all cases.  Of course
 a fallback may be required. After all according to bash
 maintainer:

Use of `echo' in portable applications has been deprecated for years.

 See: http://www.mail-archive.com/bug-bash@gnu.org/msg02150.html

 Yes, I read that comment. However I'm not prepared to start breaking the
 functionality of shells that I never use.

This is a rather strange statement. As a developer you should try to
go beyond your personal preferences. Changes to the subshell shall be
tested with all supported shells and on as many platforms as possible.
From Chet Ramey's statement it is clear that using printf is the right
thing to do.
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Pavel Tsekov
On Wed, 1 Nov 2006, Thomas Dickey wrote:

 On Wed, 1 Nov 2006, Pavel Tsekov wrote:

 Yes, I read that comment. However I'm not prepared to start breaking the
 functionality of shells that I never use.
 
 This is a rather strange statement. As a developer you should try to
 go beyond your personal preferences. Changes to the subshell shall be
 tested with all supported shells and on as many platforms as possible.
 From Chet Ramey's statement it is clear that using printf is the right
 thing to do.

 That's his statement.  Jim Meyering's comment is more reasonable.

His comment is related to coreutils and not bash. Anyway, he still
agrees that printf should be used. If this is the way to go why
shall we wait ?
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Thomas Dickey
On Wed, 1 Nov 2006, Pavel Tsekov wrote:

 On Wed, 1 Nov 2006, Thomas Dickey wrote:

 On Wed, 1 Nov 2006, Pavel Tsekov wrote:
 
 Yes, I read that comment. However I'm not prepared to start breaking the
 functionality of shells that I never use.
 
 This is a rather strange statement. As a developer you should try to
 go beyond your personal preferences. Changes to the subshell shall be
 tested with all supported shells and on as many platforms as possible.
 From Chet Ramey's statement it is clear that using printf is the right
 thing to do.
 
 That's his statement.  Jim Meyering's comment is more reasonable.

 His comment is related to coreutils and not bash. Anyway, he still
 agrees that printf should be used. If this is the way to go why
 shall we wait ?

He's recommending it for new scripts, not recommending that one rewrite 
existing scripts (and by noting that other shells retain the existing 
treatment, is pointing out a problem).

Anyway - perhaps 3.3 (I'm seeing too many reports of syntax errors in 
existing scripts to bother with 3.2.x).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Pavel Tsekov
On Wed, 1 Nov 2006, Thomas Dickey wrote:

 On Wed, 1 Nov 2006, Pavel Tsekov wrote:

 On Wed, 1 Nov 2006, Thomas Dickey wrote:
 
 On Wed, 1 Nov 2006, Pavel Tsekov wrote:
 
 Yes, I read that comment. However I'm not prepared to start breaking the
 functionality of shells that I never use.
 
 This is a rather strange statement. As a developer you should try to
 go beyond your personal preferences. Changes to the subshell shall be
 tested with all supported shells and on as many platforms as possible.
 From Chet Ramey's statement it is clear that using printf is the right
 thing to do.
 
 That's his statement.  Jim Meyering's comment is more reasonable.
 
 His comment is related to coreutils and not bash. Anyway, he still
 agrees that printf should be used. If this is the way to go why
 shall we wait ?

 He's recommending it for new scripts, not recommending that one rewrite 
 existing scripts (and by noting that other shells retain the existing 
 treatment, is pointing out a problem).

Ok. Since I am not native english speaker I cannot judge whether
he is recommending it or not. In any case I can see why keeping
the old behaviour of 'echo' is important for large scripts, however
what we have in MC is nothing as big. I just feel that what Leonard
is proposing is a hack and not an actual solution.

 Anyway - perhaps 3.3 (I'm seeing too many reports of syntax errors in 
 existing scripts to bother with 3.2.x).

Does this mean that you think that bash 3.3 will reinstantiate the old 
behaviour ?
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Thomas Dickey
On Wed, 1 Nov 2006, Pavel Tsekov wrote:

 Ok. Since I am not native english speaker I cannot judge whether
 he is recommending it or not. In any case I can see why keeping
 the old behaviour of 'echo' is important for large scripts, however
 what we have in MC is nothing as big. I just feel that what Leonard
 is proposing is a hack and not an actual solution.

 Anyway - perhaps 3.3 (I'm seeing too many reports of syntax errors in 
 existing scripts to bother with 3.2.x).

 Does this mean that you think that bash 3.3 will reinstantiate the old 
 behaviour ?

Not for this (echo -e is a dead issue, though some of the discussion 
there touches on other problems). But it would be reasonable to expect it 
to fix the syntax errors.  Before rushing off to change things to 
accommodate bash 3.2, it's worth checking if the fix will work with other 
shells.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Leonard den Ottolander
Hello Pavel,

On Wed, 2006-11-01 at 13:27 +0200, Pavel Tsekov wrote:
  Yes, I read that comment. However I'm not prepared to start breaking the
  functionality of shells that I never use.
 
 This is a rather strange statement. As a developer you should try to
 go beyond your personal preferences.

As I have limited time I will not be implementing a solution where we
replace echo -e with printf. It's not that I don't prefer such a
solution, it's just that I will not be implementing it as it will take
me too much time. As we are faced with an acute breaking when using bash
= 3.2 I am prepared to create a patch that fixes the octal issue.

Please let me know if you will be fixing the issue properly by replacing
echo -e with printf. If not I will create a fix for the octals issue as
the breakage of bash  3.2 needs to be fixed.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Pavel Tsekov
On Wed, 1 Nov 2006, Thomas Dickey wrote:

 On Wed, 1 Nov 2006, Pavel Tsekov wrote:

 Ok. Since I am not native english speaker I cannot judge whether
 he is recommending it or not. In any case I can see why keeping
 the old behaviour of 'echo' is important for large scripts, however
 what we have in MC is nothing as big. I just feel that what Leonard
 is proposing is a hack and not an actual solution.
 
 Anyway - perhaps 3.3 (I'm seeing too many reports of syntax errors in 
 existing scripts to bother with 3.2.x).
 
 Does this mean that you think that bash 3.3 will reinstantiate the old 
 behaviour ?

 Not for this (echo -e is a dead issue, though some of the discussion there 
 touches on other problems). But it would be reasonable to expect it to fix 
 the syntax errors.  Before rushing off to change things to accommodate bash 
 3.2, it's worth checking if the fix will work with other shells.

The fix which Leonard proposes would not affect the other supported
shells. Look at subshell_name_quote() in subshell.c. I am beginning
to wonther whether do we really want to escape the characters
using echo or printf.

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Leonard den Ottolander
On Wed, 2006-11-01 at 14:55 +0200, Pavel Tsekov wrote:
 I am beginning
 to wonther whether do we really want to escape the characters
 using echo or printf.

For embedded backslashes etc. I suppose we do.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Leonard den Ottolander
Hello Thomas,

On Wed, 2006-11-01 at 07:51 -0500, Thomas Dickey wrote:
 Before rushing off to change things to 
 accommodate bash 3.2, it's worth checking if the fix will work with other 
 shells.

I'm not quite sure which fix you are referring to here. The temporary
hack I send to this list should not break the other shells. All it does
is add quoting of numbers for these shells. For the (temporary, echo -e)
fix I had in mind even this change would be dropped.

My idea was to add an ini option bash_oct_digits with possible values 0
(or unset) (automatically detect version via BASH_VERSION in the calling
environment (actually querying the subshell seems a bit much) or
fallback), 1 (compatibility mode, 4 digit octals with numbers quoted,
for bash = 2.05b), 3 (legacy mode, only use 3 digit octals, no need
to escape digits) and 4 (use 4 digit octals only, no need to escape
digits, for bash = 3.2).

Please let me know if there are volunteers to implement the proper
solution (using printf) so I don't have to waste my time on a patch that
is unnecessary. Thanks.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Leonard den Ottolander
On Wed, 2006-11-01 at 15:15 +0200, Pavel Tsekov wrote:
 The printf solution wouldn't be that hard to implement in fact. It
 may be even simpler. I can look at it.

That would be nice. Thank you.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-11-01 Thread Leonard den Ottolander
Hello Thomas,

On Wed, 2006-11-01 at 08:38 -0500, Thomas Dickey wrote:
 One problem is that the user has to keep track (for the non-automatic 
 workarounds) of the bash version.

No. Default setting of 0 (or unset) of bash_octal_digits would fallback
to option 1, which works for bash = 2.05b (in contrast to the current
situation where by default only bash  3.2 will work). Only users of
bash  2.05b will have to either export BASH_VERSION (iiuc BASH_VERSINFO
is a set variable, not an environment var so unusable unless one
directly queries the subshell) or set bash_octal_digits to 3.

 Pavel's the person to talk to (I maintain other programs including 
 ncurses) - my point here was noting that bash 3.2 added other problems 
 which are definitely _bugs_ in bash, and that it would not be good to cite 
 3.2 itself as a good example, but to focus on the feature.

The issue of the octal length is independent of any bugs in bash 3.2 and
will also exist for later versions.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-31 Thread Leonard den Ottolander
Hi Pavel,

On Mon, 2006-10-30 at 11:45 +0200, Pavel Tsekov wrote:
 IMO, if you intend to work on a fix you should follow the
 suggestion of the bash maintainer to switch over to using
 printf - not only for bash but for all cases.  Of course
 a fallback may be required. After all according to bash
 maintainer:
 
Use of `echo' in portable applications has been deprecated for years.
 
 See: http://www.mail-archive.com/bug-bash@gnu.org/msg02150.html

Yes, I read that comment. However I'm not prepared to start breaking the
functionality of shells that I never use.

 I guess the bash maintainer can give you insight on how to properly
 detect the bash version (if at all necessary).

All I need to establish is whether the version is smaller than 3.2. I
think I will use BASH_VERSINFO for this. If that array doesn't exist I
will assume bash  3.2.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-30 Thread Pavel Tsekov
Hello,

On Sun, 29 Oct 2006, Leonard den Ottolander wrote:

 Hi Christian,

 On Sat, 2006-10-28 at 23:48 +0200, Christian Hamar alias krix wrote:
 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!

 Thx for the patch. It works with 3.2 (tested)

 If you can ride with BASH_VERSINFO then maybe this can be go to CVS.

 I suppose I will work with the BASH_VERSINFO environment variable. As
 you told me privately it was introduced in bash-2.0, so I suppose I will
 assume version  2 if the environment variable is not set.

IMO, if you intend to work on a fix you should follow the
suggestion of the bash maintainer to switch over to using
printf - not only for bash but for all cases.  Of course
a fallback may be required. After all according to bash
maintainer:

   Use of `echo' in portable applications has been deprecated for years.

See: http://www.mail-archive.com/bug-bash@gnu.org/msg02150.html

I guess the bash maintainer can give you insight on how to properly
detect the bash version (if at all necessary).
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-29 Thread Leonard den Ottolander
Hi Christian,

On Sat, 2006-10-28 at 23:48 +0200, Christian Hamar alias krix wrote:
  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!
 
 Thx for the patch. It works with 3.2 (tested)
 
 If you can ride with BASH_VERSINFO then maybe this can be go to CVS.

I suppose I will work with the BASH_VERSINFO environment variable. As
you told me privately it was introduced in bash-2.0, so I suppose I will
assume version  2 if the environment variable is not set.

 And if it will , then please dont forget to close #18136 :)

Yes, I usually work via the bug system.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-28 Thread Leonard den Ottolander
Hi,

If I understand the comments in the code only bash  2.05b has a problem
with 4 number octals. Indeed a test with bash-3.0 confirms this. Since
only alphas (not numbers) are not being escaped there are no problems
with directories with names like a_0 for 2.05b  bash = 3.2.

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.

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-28 Thread Leonard den Ottolander
Hi Christian,

On Sat, 2006-10-28 at 10:22 +, Christian Hamar wrote:
 I just upgraded to bash-3.2 and now mc gives me error that Cannot change
 directory to XY.. .

 http://www.mail-archive.com/bug-bash@gnu.org/msg02150.html

Fix needs to be made to subshell_name_quote() in the (subshell_type ==
BASH) block.

Does bash always set the BASH_VERSINFO environment variable and is the
syntax of this parameter portable over all versions (ie how do we best
establish bashes version)?

Leonard.

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


___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-28 Thread Leonard den Ottolander
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.0 +0200
+++ subshell.c	2006-10-28 15:40:46.0 +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));
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


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

2006-10-28 Thread Christian Hamar alias krix

 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!

Thx for the patch. It works with 3.2 (tested)

If you can ride with BASH_VERSINFO then maybe this can be go to CVS.

And if it will , then please dont forget to close #18136 :)

Ps.: My two mail sent directly to you :S sorry about that, i was lazy to
see 'To:' field :)

Regards

Christian Hamar alias krix
Hungary



___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel