[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Wrong input confuses bash's arithmetic unit permanently
From: |
Enrico Scholz |
Subject: |
Wrong input confuses bash's arithmetic unit permanently |
Date: |
Tue, 11 Sep 2007 22:23:14 +0200 |
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-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables
uname output: Linux kosh.bigo.ensc.de 2.6.22.3-ensc-1 #1 SMP PREEMPT Thu Aug 16
23:36:51 CEST 2007 i686 i686 i386 GNU/Linux
Machine Type: i686-redhat-linux-gnu
Bash Version: 3.2
Patch Level: 9
Release Status: release
Description:
A syntactical wrong statement will confuse bash permanently so that
arithmetic operations return wrong results.
Repeat-By:
[copy from https://bugzilla.redhat.com/show_bug.cgi?id=286861]
$ i=0
$ let ++i
$ echo $i
1
$ let tmp="foo.a"+0
bash: let: tmp=foo.a+0: syntax error: invalid arithmetic...
$ i=0
$ let ++i
$ echo $i
0
--> every further use of 'let' will generate bogus results. bash-3.1 returns
expected results.
- Wrong input confuses bash's arithmetic unit permanently,
Enrico Scholz <=