Skip to content

Commit a9d6d3a

Browse files
committed
Restrict zsh shwordsplit to downloader()
1 parent a027d95 commit a9d6d3a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rustup-init.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ has_local() {
1919

2020
has_local 2>/dev/null || alias local=typeset
2121

22-
# zsh does not split words by default, Required for curl retry arguments below.
23-
if [ -n "$ZSH_VERSION" ]; then
24-
setopt shwordsplit
25-
fi
22+
is_zsh() {
23+
[ -n "${ZSH_VERSION-}" ]
24+
}
2625

2726
set -u
2827

@@ -575,6 +574,9 @@ ignore() {
575574
# This wraps curl or wget. Try curl first, if not installed,
576575
# use wget instead.
577576
downloader() {
577+
# zsh does not split words by default, Required for curl retry arguments below.
578+
is_zsh && setopt local_options shwordsplit
579+
578580
local _dld
579581
local _ciphersuites
580582
local _err

0 commit comments

Comments
 (0)