From c8a7f54766a657d23c55d3309b46fce01a65bca5 Mon Sep 17 00:00:00 2001 From: Markus Date: Sun, 24 Nov 2019 13:34:10 +0100 Subject: [PATCH] v3.7.5: fix big error: when no link for the first langue was found error at the other languages: no reset istringstream --- src/pageManager.cpp | 6 ++++-- src/parameterManager.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pageManager.cpp b/src/pageManager.cpp index 846b520..bd6cf8f 100644 --- a/src/pageManager.cpp +++ b/src/pageManager.cpp @@ -464,7 +464,6 @@ int PageManager::writeToFile(std::string path, std::string text) std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first) { std::istringstream SListLang ( replace( languages_with_highst_priority_at_first, ",", "\n") + "\n" ); - std::istringstream SListHoster( replace( Hoster_with_Highst_Priority_at_First, ",", "\n") + "\n" ); int LangId = 0; size_t pos = 0; @@ -473,6 +472,9 @@ std::string PageManager::chooseHosterLink(std::string HosterList, std::string Ho //Für jede Sprache: while (getline(SListLang, langId).good()) { + //Erst in schleife: weil es sonst ein problem wegen dem readdevice beim 2.ten durchlauf gibt + std::istringstream SListHoster( replace( Hoster_with_Highst_Priority_at_First, ",", "\n") + "\n" ); + if(langId == "") continue; else if ( langId == "GerDub" ) @@ -501,7 +503,7 @@ std::string PageManager::chooseHosterLink(std::string HosterList, std::string Ho //std::cout << "Hoster " << hoster << " gibt es bei der sprache" << langId << " nicht " << std::endl; continue; } - Line = grep(LanguageSortedHoster, ("hoster=\"" + hoster + "\"" ) ); + Line = grep(LanguageSortedHoster + "\n", ("hoster=\"" + hoster + "\"" ) ); pos = Line.find("href=\""); if(pos == std::string::npos) { std::cout << " => Error: Konnte 'href=\"' in chooseHosterLink() nicht finden." << std::endl; diff --git a/src/parameterManager.h b/src/parameterManager.h index 9e91782..2b6101f 100644 --- a/src/parameterManager.h +++ b/src/parameterManager.h @@ -81,7 +81,7 @@ struct Settings { proxy_ip = "127.0.0.1", languages = "GerDub,GerSub,Eng,", genaueHoster = "", - version = "3.7.4", + version = "3.7.5", defaultFileVersion="1.7", outputFilePath = "", default_checkPath = "",