bash_completion: Enable extglob while parsing file
authorMichael Hanselmann <hansmi@google.com>
Mon, 24 Sep 2012 13:03:53 +0000 (15:03 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 25 Sep 2012 11:14:28 +0000 (13:14 +0200)
commit893ad76d18e1a8286247e06c8451bbd4831cff8f
treed7190f1764c7a9c341b729e09b2d55fb82ea76e0
parent34dfced1774dd80184a96cdf6e128ce38fdda2c2
bash_completion: Enable extglob while parsing file

In older versions of GNU Bash extended patterns, such as “@(…)”, are only
available with the “extglob” shell option. As pointed out in [1] and [2],
“extglob” must be enabled while parsing the code. Therefore the flag must be
enabled at the beginning of the script and be reset to its original value at
the end as to not interfere with other code on shell initialization.

[1] http://unix.stackexchange.com/questions/45957
[2] http://mywiki.wooledge.org/glob

Reported by Sascha Lucas.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
autotools/build-bash-completion