Re: Intriguing error with arithmetic evaluation

2016-08-16 Thread Chet Ramey
On 8/16/16 12:16 PM, L. A. Walsh wrote: The relevant change was probably the change in the set of commands to which `set -e' applies. The change was the result of Posix changing the semantics of the errexit option and expanding its scope from simple commands to all commands. >

Re: Intriguing error with arithmetic evaluation

2016-08-16 Thread Greg Wooledge
On Tue, Aug 16, 2016 at 09:16:50AM -0700, L. A. Walsh wrote: > Perhaps you can explain why bash's "normal mode" had to change? I don't have a "why", but I do note this on http://mywiki.wooledge.org/BashFAQ/105/Answers See the answer for "Exercise 2". I repeat, because it needs to be repeated ev

Re: Intriguing error with arithmetic evaluation

2016-08-16 Thread L. A. Walsh
Chet Ramey wrote: On 8/15/16 6:15 AM, L. A. Walsh wrote: Chet Ramey wrote: The relevant change was probably the change in the set of commands to which `set -e' applies. The change was the result of Posix changing the semantics of the errexit option and expanding its scope from simp

Re: Potential buffer under-run in shell_execve()

2016-08-16 Thread Chet Ramey
On 8/13/16 10:01 PM, John E. Malmberg wrote: > Hello, > > In Bash 4.3.42: > > In execute_cmd/shell_execve(), if HAVE_BASH_BANG_EXEC is defined, the macro > READ_SAMPLE_BUF has the potential to set sample_len to -1. > > #if defined (HAVE_HASH_BANG_EXEC) > READ_SAMPLE_BUF (command, sampl

Re: Curious case statement error

2016-08-16 Thread Chet Ramey
On 8/13/16 3:59 PM, Eduardo Bustamante wrote: > Character ranges are locale-dependant. Check the values of LC_ALL and > LC_COLLATE. Under some locales, the [A-Z] range is actually AaBb..Z. That's > why it's better to use the character classes, i.e. [[:alpha:]], > [[:lower:]], [[:upper:]], etc. Thi

Re: Intriguing error with arithmetic evaluation

2016-08-16 Thread Chet Ramey
On 8/15/16 6:15 AM, L. A. Walsh wrote: > > > Chet Ramey wrote: >> The relevant change was probably the change in the set of commands to which >> `set -e' applies. The (( command (among others) was added to that list >> in bash-4.1. The change was the result of Posix changing the semantics >> of