lib/shopt: Remove nocasematch (#503)

The setting `shopt -s nocasematch` affects every pattern matching in
Bash including the case statement, [[ str == pat ]] matching,
${var/pat/rep}, and ${var#pat}.  Since the affected range is too
large, this potentially breaks the existing functions.  This setting
`shopt -s nocasematch` seems the one that should be enabled locally
when it is specifically needed rather than being enabled globally.
This commit is contained in:
Koichi Murase
2023-12-28 11:08:42 +09:00
committed by GitHub
parent c61e349d2c
commit 8fcc79f49b

View File

@ -25,10 +25,8 @@ shopt -s globstar 2> /dev/null
# (used in case, [[]], word expansions and command completions)
if [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == true ]]; then
shopt -u nocaseglob
shopt -u nocasematch
else
shopt -s nocaseglob
shopt -s nocasematch
fi
## SMARTER TAB-COMPLETION (Readline bindings) ##