Skip to content

Commit 465dec7

Browse files
authored
Merge pull request #64 from curl/samueloph/rename_vars
Consistent variable names for feature checks
2 parents 85e6be8 + c1c8d81 commit 465dec7

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

wcurl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,19 @@ exec_curl()
186186
curl_version_major=$(echo "$curl_version" | cut -f1 -d.)
187187
curl_version_minor=$(echo "$curl_version" | cut -f2 -d.)
188188

189-
CURL_HAS_NO_CLOBBER=""
190-
CURL_HAS_PARALLEL=""
189+
CURL_NO_CLOBBER=""
190+
CURL_PARALLEL=""
191191
# --no-clobber is only supported since 7.83.0.
192192
# --parallel is only supported since 7.66.0.
193193
if [ "${curl_version_major}" -ge 8 ]; then
194-
CURL_HAS_NO_CLOBBER="--no-clobber"
195-
CURL_HAS_PARALLEL="--parallel"
194+
CURL_NO_CLOBBER="--no-clobber"
195+
CURL_PARALLEL="--parallel"
196196
elif [ "${curl_version_major}" -eq 7 ]; then
197197
if [ "${curl_version_minor}" -ge 83 ]; then
198-
CURL_HAS_NO_CLOBBER="--no-clobber"
198+
CURL_NO_CLOBBER="--no-clobber"
199199
fi
200200
if [ "${curl_version_minor}" -ge 66 ]; then
201-
CURL_HAS_PARALLEL="--parallel"
201+
CURL_PARALLEL="--parallel"
202202
fi
203203
fi
204204

@@ -207,9 +207,8 @@ exec_curl()
207207
# shellcheck disable=SC2086
208208
set -- $URLS
209209

210-
if [ "$#" -gt 1 ]; then
211-
CURL_PARALLEL="$CURL_HAS_PARALLEL"
212-
else
210+
# If there are less than two URLs, don't set the parallel flag.
211+
if [ "$#" -lt 2 ]; then
213212
CURL_PARALLEL=""
214213
fi
215214

@@ -231,7 +230,7 @@ exec_curl()
231230
[ -z "${OUTPUT_PATH}" ] && OUTPUT_PATH=index.html
232231
fi
233232
# shellcheck disable=SC2086
234-
set -- "$@" ${NEXT_PARAMETER} ${PER_URL_PARAMETERS} ${CURL_HAS_NO_CLOBBER} --output "${OUTPUT_PATH}" ${CURL_OPTIONS} "${url}"
233+
set -- "$@" ${NEXT_PARAMETER} ${PER_URL_PARAMETERS} ${CURL_NO_CLOBBER} --output "${OUTPUT_PATH}" ${CURL_OPTIONS} "${url}"
235234
NEXT_PARAMETER="--next"
236235
done
237236

0 commit comments

Comments
 (0)