From f52a4d6dae3000396d810e9b56be64af16b7ff74 Mon Sep 17 00:00:00 2001 From: Markus Date: Sat, 17 Aug 2019 18:33:24 +0200 Subject: [PATCH] fix errors --- parameterManager.cpp | 13 +++++-------- programManager.cpp | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/parameterManager.cpp b/parameterManager.cpp index 4c1e262..f39b166 100644 --- a/parameterManager.cpp +++ b/parameterManager.cpp @@ -132,7 +132,7 @@ int loadDefaulOptions(Settings &settings) } else if (what == "Socks5Proxy") { ///--- if(data.find(":") == std::string::npos) { - std::cout << " => Error_Defaults: Ungültiger Socks5 Proxy: " << optarg << std::endl; + std::cout << " => Error_Defaults: Ungültiger Socks5 Proxy: '" << data << "'" << std::endl; return 31; } std::string ip = data.substr(0, data.find(":")); @@ -184,15 +184,14 @@ int loadDefaulOptions(Settings &settings) } else if (what == "default-CheckMaxDirs") { settings.default_maxDirs = atoi(data.c_str()); if(std::to_string(settings.default_maxDirs) != data ) { - std::cout << " => Error_Defaults: Ungültige Zahl: " << data << std::endl; + std::cout << " => Error_Defaults: default-CheckMaxDirs: Ungültige Zahl: " << data << std::endl; return 18; } if(settings.debugMode) - std::cout << " > Defaults: SuchMuster: " << settings.default_Searchmuster << std::endl; + std::cout << " > Defaults: default-CheckMaxDirs: " << settings.default_maxDirs << std::endl; } else if (what == "default-maxThreads") { - settings.maxThreads = static_cast(atoi(data.c_str())); if(std::to_string(settings.maxThreads) != data ) { std::cout << " => Error_Defaults: Ungültige Zahl: " << data << std::endl; @@ -201,8 +200,6 @@ int loadDefaulOptions(Settings &settings) if(settings.debugMode) std::cout << " > Defaults: MaxThreads: " << settings.maxThreads << std::endl; - break; - } else if (what == "FarbloseAusgabe") { if(data == "true") settings.colorless=true; @@ -400,7 +397,7 @@ int unterOption_default(Settings *settings, int argc, char ** argv) if(optarg) settings->default_Searchmuster = optarg; if(settings->debugMode) - std::cout << "SearchMuster: " << settings->default_Searchmuster << std::endl; + std::cout << " SearchMuster: " << settings->default_Searchmuster << std::endl; break; case 'D': if(!optarg) @@ -411,7 +408,7 @@ int unterOption_default(Settings *settings, int argc, char ** argv) return 18; } if(settings->debugMode) - std::cout << "SearchMuster: " << settings->default_Searchmuster << std::endl; + std::cout << "CheckMaxDirs: " << settings->default_maxDirs << std::endl; break; case 't': diff --git a/programManager.cpp b/programManager.cpp index 5d6ebb7..9133b4e 100644 --- a/programManager.cpp +++ b/programManager.cpp @@ -136,7 +136,7 @@ int ProgramManager::defaultModus(Settings *settings) } //Überprüfe ob ein Muster existiert: - if(settings->default_Searchmuster == "") { + if(settings->default_checkDirPath != "" && settings->default_Searchmuster == "") { std::cout << " => Error: [-m]: Kein Muster angegeben." << std::endl; return 31; } @@ -611,7 +611,7 @@ int ProgramManager::searchModus_update(Settings *settings) int ProgramManager::listDir(std::string &list,std::string path, int maxDepth) { - if(maxDepth == 0) + if(maxDepth <= 0) return 0; else if(!dirExists(path)) { std::cout << " => Error: Verzeichnis '" << path << "' existiert nicht oder ist kein Ordner." << std::endl;