diff --git a/passes/cmds/plugin.cc b/passes/cmds/plugin.cc index 329aa4cee..4ccd8e5d4 100644 --- a/passes/cmds/plugin.cc +++ b/passes/cmds/plugin.cc @@ -41,6 +41,9 @@ std::map loaded_python_plugins; std::map loaded_plugin_aliases; #ifdef YOSYS_ENABLE_PLUGINS + +static constexpr const char *path_delimiters = fs::path::preferred_separator == '\\' ? ";" : ":" ; + inline const std::vector get_plugin_search_paths() { std::vector result; const char *yosys_plugin_path = std::getenv("YOSYS_PLUGIN_PATH"); @@ -50,7 +53,7 @@ inline const std::vector get_plugin_search_paths() { std::string copy{yosys_plugin_path}; char *token = nullptr; char *rest = ©[0]; - while ((token = strtok_r(rest, ":", &rest))) { + while ((token = strtok_r(rest, path_delimiters, &rest))) { result.push_back(fs::path(token)); } }