Skip to content

Commit 796c9d2

Browse files
authored
Merge pull request #2328 from Artoria2e5/patch-1
Return early in check_help_for
2 parents 7d76ded + 4665f78 commit 796c9d2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

rustup-init.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,9 @@ check_help_for() {
428428
local _arch
429429
local _cmd
430430
local _arg
431-
local _ok
432431
_arch="$1"
433432
shift
434433
_cmd="$1"
435-
_ok="y"
436434
shift
437435

438436
case "$_arch" in
@@ -444,7 +442,7 @@ check_help_for() {
444442
if [ "$(sw_vers -productVersion | cut -d. -f2)" -lt 13 ]; then
445443
# Older than 10.13
446444
echo "Warning: Detected OS X platform older than 10.13"
447-
_ok="n"
445+
return 1
448446
fi
449447
fi
450448
;;
@@ -453,11 +451,11 @@ check_help_for() {
453451

454452
for _arg in "$@"; do
455453
if ! "$_cmd" --help | grep -q -- "$_arg"; then
456-
_ok="n"
454+
return 1
457455
fi
458456
done
459457

460-
test "$_ok" = "y"
458+
true # not strictly needed
461459
}
462460

463461
# Return cipher suite string specified by user, otherwise return strong TLS 1.2-1.3 cipher suites

0 commit comments

Comments
 (0)