Skip to content

Commit a1ea2a5

Browse files
author
neil
committed
1 parent fc3bfda commit a1ea2a5

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

acme.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,28 @@ _secure_debug3() {
436436
fi
437437
}
438438

439+
__USE_TR_TAG=""
440+
if [ "$(echo "abc" | LANG=C tr a-z A-Z 2>/dev/null)" != "ABC" ] ; then
441+
__USE_TR_TAG="1"
442+
fi
443+
export __USE_TR_TAG
444+
439445
_upper_case() {
446+
if [ "$__USE_TR_TAG" ]; then
447+
LANG=C tr '[:lower:]' '[:upper:]'
448+
else
440449
# shellcheck disable=SC2018,SC2019
441-
tr '[a-z]' '[A-Z]'
450+
LANG=C tr '[a-z]' '[A-Z]'
451+
fi
442452
}
443453

444454
_lower_case() {
445-
# shellcheck disable=SC2018,SC2019
446-
tr '[A-Z]' '[a-z]'
455+
if [ "$__USE_TR_TAG" ]; then
456+
LANG=C tr '[:upper:]' '[:lower:]'
457+
else
458+
# shellcheck disable=SC2018,SC2019
459+
LANG=C tr '[A-Z]' '[a-z]'
460+
fi
447461
}
448462

449463
_startswith() {

0 commit comments

Comments
 (0)