From dce70abd94caaa81eeb4c9bf97548db8517fb193 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Wed, 15 Oct 2025 15:53:44 +0300 Subject: [PATCH] plugins: support Windows path delimiters --- passes/cmds/plugin.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)); } }