Fixed usages of path_list_separator

This commit is contained in:
Elad Solomon 2022-09-08 19:57:08 +03:00 committed by Tomer Lev
parent 4043b67e0b
commit dfd6cbe6b4
3 changed files with 6 additions and 6 deletions

View file

@ -63,7 +63,7 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
std::stringstream s(dir); std::stringstream s(dir);
std::string d; std::string d;
while ( std::getline(s, d, path_list_separator) ) while ( std::getline(s, d, path_list_separator[0]) )
SearchDynamicPlugins(d); SearchDynamicPlugins(d);
return; return;

View file

@ -71,7 +71,7 @@ static bool can_read(const string& path)
} }
static string zeek_path_value; static string zeek_path_value;
const string zeek_path_list_separator(1, path_list_separator); const string zeek_path_list_separator(path_list_separator.begin(), path_list_separator.end());
namespace zeek::util namespace zeek::util
{ {
@ -576,7 +576,7 @@ void add_to_zeek_path(const string& dir)
// Make sure path is initialized. // Make sure path is initialized.
zeek_path(); zeek_path();
zeek_path_value += string(zeek_path_list_separator) + dir; zeek_path_value += zeek_path_list_separator + dir;
} }
FILE* open_package(string& path, const string& mode) FILE* open_package(string& path, const string& mode)
@ -754,7 +754,7 @@ string without_zeekpath_component(std::string_view path)
{ {
string rval = normalize_path(path); string rval = normalize_path(path);
const auto paths = tokenize_string(zeek_path(), path_list_separator); const auto paths = tokenize_string(zeek_path(), path_list_separator[0]);
for ( size_t i = 0; i < paths.size(); ++i ) for ( size_t i = 0; i < paths.size(); ++i )
{ {

View file

@ -78,9 +78,9 @@ extern HeapLeakChecker* heap_checker;
#endif #endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
const char path_list_separator = ';'; inline constexpr std::string_view path_list_separator = ";";
#else #else
const char path_list_separator = ':'; inline constexpr std::string_view path_list_separator = ":";
#endif #endif
extern "C" extern "C"