Преглед на файлове

Remove "//" from rulebase download status file.

master
Alban Deniz преди 6 години
родител
ревизия
4b4f566081
променени са 1 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 10
    3
      Common/UtilityConfig.cpp

+ 10
- 3
Common/UtilityConfig.cpp Целия файл

@@ -57,7 +57,7 @@ const std::string ScriptNameKey("SCRIPT"); ///< Text to replace with script name
const std::string SnifferPathKey("SNIFFER_PATH"); ///< Text to replace with directory of the rulebase.
// SNIFFER_PATH is replaced with the path of the rulebase.
const std::string UtilityConfig::RulebaseDownloadStatusFile("SNIFFER_PATH/getRulebase.status");
const std::string UtilityConfig::RulebaseDownloadStatusFile("SNIFFER_PATHgetRulebase.status");
#ifdef DEFAULT_DATA_DIR
// *nix, DEFAULT_DATA_DIR is specified on the compile command line.
@@ -251,8 +251,15 @@ UtilityConfig::GetWorkspacePath(void) {
string
UtilityConfig::GetRulebasePath(void) {
return CFGData.paths_rulebase_path;
if (CFGData.paths_rulebase_path.empty())
return "";
// Ensure that there's a trailing "/".
if (CFGData.paths_rulebase_path[CFGData.paths_rulebase_path.length() - 1] ==
'/')
return CFGData.paths_rulebase_path;
return CFGData.paths_rulebase_path + "/";
}
string
@@ -1132,7 +1139,7 @@ UtilityConfig::DownloadRulebase() {
if (!Input) {
string Temp;
Temp = "Error opening rulebase download scriptstatus file " + StatusFile;
Temp = "Error opening rulebase download script status file " + StatusFile;
Temp += ": ";
Temp += strerror(errno);
throw std::runtime_error(Temp);

Loading…
Отказ
Запис