From 1f6f4db6954de648bf5dc00bdf40a4f376eff6d8 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:20:41 +1300 Subject: [PATCH] register: Remove Use `string::find_last_of()` instead. Not sure how this works on windows, but it was already using '/' so at least it's not any worse. --- kernel/register.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/register.cc b/kernel/register.cc index 1723e3f6d59..9645546d0f1 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -26,7 +26,6 @@ #include #include #include -#include #ifdef YOSYS_ENABLE_ZLIB #include @@ -1063,9 +1062,10 @@ struct HelpPass : public Pass { else if (source_file.find("techlibs/") == 0 || (!has_source && name.find("synth_") == 0)) cmd_help.group = "techlibs"; else if (has_source) { - auto p = std::filesystem::path(source_file); - if (p.has_parent_path()) { - cmd_help.group = string(p.parent_path()); + auto last_slash = source_file.find_last_of('/'); + if (last_slash != string::npos) { + auto parent_path = source_file.substr(0, last_slash); + cmd_help.group = parent_path; } } // implicit !has_source