Skip to content

Commit

Permalink
lib/shopt: remove nocasematch
Browse files Browse the repository at this point in the history
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 exiting functions.  I think this
settings `shopt -s nocasematch` should be enabled locally when it is
specifically needed rather than enabling it globally.
  • Loading branch information
akinomyoga committed Dec 11, 2023
1 parent 00f28e4 commit 04f8535
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/shopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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) ##
Expand Down

0 comments on commit 04f8535

Please sign in to comment.