Download primitives: update was their only caller. */
| 6976 | |
| 6977 | /* Download primitives: update was their only caller. */ |
| 6978 | static int cbm_download_to_file(const char *url, const char *dest) { |
| 6979 | const char *protocol = cli_download_protocol(url); |
| 6980 | if (!protocol || !dest) { |
| 6981 | (void)fprintf(stderr, "error: update downloads require HTTPS (file:// is " |
| 6982 | "reserved for an explicit CBM_DOWNLOAD_URL test " |
| 6983 | "override)\n"); |
| 6984 | return CLI_TRUE; |
| 6985 | } |
| 6986 | const char *argv[] = {"curl", "-fSL", "--progress-bar", |
| 6987 | "--proto", protocol, "--proto-redir", |
| 6988 | protocol, "-o", dest, |
| 6989 | url, NULL}; |
| 6990 | return cbm_exec_no_shell(argv); |
| 6991 | } |
| 6992 | |
| 6993 | static int cbm_download_to_file_quiet(const char *url, const char *dest) { |
| 6994 | const char *protocol = cli_download_protocol(url); |
no test coverage detected