From c0a0e90e405bac4dfc5819df429d567e8a51650d Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 16 Feb 2018 16:06:27 +0100 Subject: Make scope.sh backwards compatible with bash v3 Bash v3 doesn't support the `,,` syntax for lowercasing. This is relevant on Mac OS which still comes with bash v3.2. Using `:upper:` and `:lower:` with `tr` takes into account the locale so this allows letters with diacritical marks in extensions. This behavior may not be desirable. Fixes #1072 --- ranger/data/scope.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 35021129..540a910e 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -31,7 +31,7 @@ IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise. FILE_EXTENSION="${FILE_PATH##*.}" -FILE_EXTENSION_LOWER="${FILE_EXTENSION,,}" +FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]') # Settings HIGHLIGHT_SIZE_MAX=262143 # 256KiB -- cgit 1.4.1-2-gfad0