From 73a1ff82d25560746fae3fb4cbc51df6acbbd786 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 4 Oct 2021 17:42:19 +0100 Subject: [PATCH] utils/curl: fix flag handling --- Library/Homebrew/utils/curl.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 97eb98373d..37a4f71e4f 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -304,7 +304,13 @@ module Utils ) file = Tempfile.new.tap(&:close) - specs = specs.flat_map { |option, argument| ["--#{option.to_s.tr("_", "-")}", argument] } + specs = specs.flat_map do |option, argument| + next if argument == false # No flag. + + args = ["--#{option.to_s.tr("_", "-")}"] + args << argument unless argument == true # It's a flag. + args + end max_time = hash_needed ? 600 : 25 output, _, status = curl_output( *specs, "--dump-header", "-", "--output", file.path, "--location", url,