forked from markus/S_New4
v3.7.2: überprüfe die neuste Version nach download, wenn zumBeisiel html error in html steht
This commit is contained in:
parent
0414d3a8aa
commit
732b2d5940
@ -81,7 +81,7 @@ struct Settings {
|
||||
proxy_ip = "127.0.0.1",
|
||||
languages = "GerDub,GerSub,Eng,",
|
||||
genaueHoster = "",
|
||||
version = "3.7.1",
|
||||
version = "3.7.2",
|
||||
defaultFileVersion="1.6",
|
||||
outputFilePath = "",
|
||||
default_checkPath = "",
|
||||
|
@ -1059,6 +1059,16 @@ int ProgramManager::updateModus(Settings *settings)
|
||||
std::string neusteVersion = html.substr(0, html.find("\n"));
|
||||
html.erase(0, html.find("\n") + 1);
|
||||
|
||||
//Überprüfe onb neue Version einen . enthält
|
||||
if(neusteVersion.find(".") == std::string::npos) {
|
||||
size_t pos;
|
||||
if((pos = html.find("h1>")) != std::string::npos)
|
||||
std::cout << " => Das herunterladen ist fehlgeschlagen: " << html.substr(pos + 3, html.find("</h1>") - pos);
|
||||
else
|
||||
std::cout << " => Error: Die neuste Version ist ungültig: '" << neusteVersion << "'." << std::endl;
|
||||
return -3;
|
||||
}
|
||||
|
||||
//Gib Versionenunterschie aus
|
||||
std::cout << " => INFO: Jetzige Version: '" << settings->version << "' - Neueste Version: '" << neusteVersion << "'" << std::endl;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user