From ca8cb28cba4d53401ec67ded884059bccb1ef820 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 11 Dec 2023 15:34:48 +0900 Subject: [PATCH] lib/shopt: Remove nocasematch 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. --- lib/shopt.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/shopt.sh b/lib/shopt.sh index 2f748af67..589b710b1 100644 --- a/lib/shopt.sh +++ b/lib/shopt.sh @@ -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) ##