Browse Source

Remove "//" from rulebase download status file.

master
Alban Deniz 6 years ago
parent
commit
4b4f566081
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      Common/UtilityConfig.cpp

+ 10
- 3
Common/UtilityConfig.cpp View File

const std::string SnifferPathKey("SNIFFER_PATH"); ///< Text to replace with directory of the rulebase. const std::string SnifferPathKey("SNIFFER_PATH"); ///< Text to replace with directory of the rulebase.
// SNIFFER_PATH is replaced with the path 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 #ifdef DEFAULT_DATA_DIR
// *nix, DEFAULT_DATA_DIR is specified on the compile command line. // *nix, DEFAULT_DATA_DIR is specified on the compile command line.
string string
UtilityConfig::GetRulebasePath(void) { 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 string
if (!Input) { if (!Input) {
string Temp; string Temp;
Temp = "Error opening rulebase download scriptstatus file " + StatusFile;
Temp = "Error opening rulebase download script status file " + StatusFile;
Temp += ": "; Temp += ": ";
Temp += strerror(errno); Temp += strerror(errno);
throw std::runtime_error(Temp); throw std::runtime_error(Temp);

Loading…
Cancel
Save