bash-3.00.16 on IRIX incorrectly handles PAREN_ARITHMETIC

2005-09-29 Thread Stuart Shelton


Configuration Information [Automatically generated, do not change]:
Machine: mips
OS: irix6.5
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='mips' 
-DCONF_OSTYPE='irix6.5' -DCONF_MACHTYPE='mips-sgi-irix6.5' 
-DCONF_VENDOR='sgi' -DLOCALEDIR='/usr/bsd/share/locale' -DPACKAGE='bash' 
-DSHELL  -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib -I./lib/intl 
-I/usr/include -c99 -O2 -n32 -mips4 -r12000 -apo -float_const 
-use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r12000 
-TENV:zeroinit_in_bss=ON -DEFAULT:platform=ip30 
-OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON 
-LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 
1174,1183,1552 -n32 -I/usr/include

uname output: IRIX64 octane 6.5 07010238 IP30
Machine Type: mips-sgi-irix6.5

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:

PAREN_ARITHMETIC seems to be broken when bash-3.00 is compiled on IRIX:
e.g.

$ bash-2.05 -c 'A=$(( 2 + 3 )); echo $A'
5

$ bash-3.00 -c 'A=$(( 2 + 3 )); echo $A'
2: command not found

And, infact, there may be some form of off-by-one error here:

$ bash-3.00 -c 'A=$(x(2+3)); echo $A'
5

... so it looks as if the character immediately following the initial
opening bracket is dropped.

Repeat-By:

Compile bash on an IRIX machine using SGI's compiler suite
(MIPSpro 7.4.3m, in this instance).

Have yet to confirm whether bash compiled with GCC has the same problem...

Cheers,

Stuart


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: bash-3.00.16 on IRIX incorrectly handles PAREN_ARITHMETIC

2005-09-29 Thread Chet Ramey
Stuart Shelton wrote:
> 
> Configuration Information [Automatically generated, do not change]:
> Machine: mips
> OS: irix6.5
> Compiler: cc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='mips'
> -DCONF_OSTYPE='irix6.5' -DCONF_MACHTYPE='mips-sgi-irix6.5'
> -DCONF_VENDOR='sgi' -DLOCALEDIR='/usr/bsd/share/locale' -DPACKAGE='bash'
> -DSHELL  -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib -I./lib/intl
> -I/usr/include -c99 -O2 -n32 -mips4 -r12000 -apo -float_const
> -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r12000
> -TENV:zeroinit_in_bss=ON -DEFAULT:platform=ip30
> -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON
> -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff
> 1174,1183,1552 -n32 -I/usr/include
> uname output: IRIX64 octane 6.5 07010238 IP30
> Machine Type: mips-sgi-irix6.5
> 
> Bash Version: 3.0
> Patch Level: 16
> Release Status: release
> 
> Description:
> 
> PAREN_ARITHMETIC seems to be broken when bash-3.00 is compiled on IRIX:
> e.g.
> 
> $ bash-2.05 -c 'A=$(( 2 + 3 )); echo $A'
> 5
> 
> $ bash-3.00 -c 'A=$(( 2 + 3 )); echo $A'
> 2: command not found
> 
> And, infact, there may be some form of off-by-one error here:
> 
> $ bash-3.00 -c 'A=$(x(2+3)); echo $A'
> 5
> 
> ... so it looks as if the character immediately following the initial
> opening bracket is dropped.

This appears to be irix-specific.  Are you using yacc or bison?  That
could be a cause as well.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://tiswww.tis.case.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Fix for HISTCMD when HISTFILE is defined, but HISTSIZE is not

2005-09-29 Thread Geoff Odhner
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/home/geoff/i686/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H  -I.  -I.. -I../include -I../lib   -g -O2
uname output: Linux monster 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 
i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
Unsetting HISTSIZE allows an unlimited number of entries in the 
history, but it unfortunately causes $HISTCMD to evaluate as 1.
This should only happen if HISTFILE is unset.

Repeat-By:
execute the following two command lines:

% unset HISTSIZE
% echo HISTCMD=$HISTCMD
HISTCMD=1
% 

Fix:
The following patch corrects the problem, making HISTCMD
available whenever there is a history file:

==
diff -Naur bash-3.0/bashhist.c bash-3.0-fixed/bashhist.c
--- bash-3.0/bashhist.c   2004-03-22 08:27:59.0 -0500
+++ bash-3.0-fixed/bashhist.c 2005-09-29 09:53:19.903722088 -0400
@@ -706,7 +706,7 @@
 history_number ()
 {
   using_history ();
-  return (get_string_value ("HISTSIZE") ? history_base + where_history () : 1);
+  return (get_string_value ("HISTFILE") ? history_base + where_history () : 1);
 }
 
 static int
==


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Fix for HISTCMD when HISTFILE is defined, but HISTSIZE is not

2005-09-29 Thread Geoff Odhner
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/home/geoff/i686/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H  -I.  -I.. -I../include -I../lib   -g -O2
uname output: Linux monster 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 
i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
Unsetting HISTSIZE allows an unlimited number of entries in the 
history, but it unfortunately causes $HISTCMD to evaluate as 1.
This should only happen if HISTFILE is unset.

Repeat-By:
execute the following two command lines:

% unset HISTSIZE
% echo HISTCMD=$HISTCMD
HISTCMD=1
% 

Fix:
The following patch corrects the problem, making HISTCMD
available whenever there is a history file:

==
diff -Naur bash-3.0/bashhist.c bash-3.0-fixed/bashhist.c
--- bash-3.0/bashhist.c   2004-03-22 08:27:59.0 -0500
+++ bash-3.0-fixed/bashhist.c 2005-09-29 09:53:19.903722088 -0400
@@ -706,7 +706,7 @@
 history_number ()
 {
   using_history ();
-  return (get_string_value ("HISTSIZE") ? history_base + where_history () : 1);
+  return (get_string_value ("HISTFILE") ? history_base + where_history () : 1);
 }
 
 static int
==


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash