bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug with BASHOPTS and compatXX-Flags in 4.3 and 4.4 alpha


From: Vehlow , Jörg
Subject: Bug with BASHOPTS and compatXX-Flags in 4.3 and 4.4 alpha
Date: Fri, 19 Feb 2016 16:52:07 +0000

Hi,

 

when the option compatXX iss et through BASHOPTS, shopt will report it tob e set, but it is not applied.

A simple test case is:

 

# compat31 enables the quoting of regular expressions

bash -c ‘ [[ "1" =~ "[1]" ]]; echo $?' à Outut is 1

bash -c 'shopt -s compat31; [[ "1" =~ "[1]" ]]; echo $?' à Output is 0

 

# from a non bash shell

# setting compat31 through BASHOPTS

BASHOPTS=compat31 bash -c 'shopt compat31; [[ "1" =~ "[1]" ]]; echo $?'

 

This should output

compat31 on

0

 

It will output

compat31 on

1

 

So it pretends, that compat31 is enabled, but it is not. The reason is, that for options set using BASHOPTS the set_funcs are not called.

The attached patch will fix this.

 

 

Greetings,

Jörg

Attachment: shopt_BASHOPTS.patch
Description: shopt_BASHOPTS.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]