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);