From 0a581db92fcc366d22deda551e5ac1dd8623f014 Mon Sep 17 00:00:00 2001 From: KhodiukMR Date: Mon, 27 May 2024 14:01:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=82=D0=BE=D0=B33(10=20=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BD=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommonVar.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CommonVar.cpp b/CommonVar.cpp index 76c105a..e7fbeaf 100644 --- a/CommonVar.cpp +++ b/CommonVar.cpp @@ -57,9 +57,8 @@ Download(const string& address, const string& option) { } CURL* curl = curl_easy_init(); if (curl) { - CURLcode res; - curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); + curl_easy_setopt(curl, CURLOPT_URL, (option == "" || option == "-verbose") ? address.c_str() : option.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); if (address == "-verbose" || option == "-verbose") { @@ -85,7 +84,13 @@ int main(int argc, char* argv[]) { double MaxCount = 0; Input in; if (argc > 1) { - in = Download(argv[1], argv[2]); + if (argc == 2) { + in = Download(argv[1], ""); + } + else { + in = Download(argv[1], argv[2]); + } + } else { in = InputData(cin, true);