Download primitives: update was their only caller. */
| 6914 | |
| 6915 | /* Download primitives: update was their only caller. */ |
| 6916 | static int cbm_download_to_file(const char *url, const char *dest) { |
| 6917 | const char *protocol = cli_download_protocol(url); |
| 6918 | if (!protocol || !dest) { |
| 6919 | (void)fprintf(stderr, "error: update downloads require HTTPS (file:// is " |
| 6920 | "reserved for an explicit CBM_DOWNLOAD_URL test " |
| 6921 | "override)\n"); |
| 6922 | return CLI_TRUE; |
| 6923 | } |
| 6924 | const char *argv[] = {"curl", "-fSL", "--progress-bar", |
| 6925 | "--proto", protocol, "--proto-redir", |
| 6926 | protocol, "-o", dest, |
| 6927 | url, NULL}; |
| 6928 | return cbm_exec_no_shell(argv); |
| 6929 | } |
| 6930 | |
| 6931 | static int cbm_download_to_file_quiet(const char *url, const char *dest) { |
| 6932 | const char *protocol = cli_download_protocol(url); |
no test coverage detected