We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dbNetwork::name(const Instance* instance)
1 parent 83ff256 commit ecbe9a5Copy full SHA for ecbe9a5
1 file changed
src/dbSta/src/dbNetwork.cc
@@ -824,7 +824,18 @@ const char* dbNetwork::name(const Instance* instance) const
824
}
825
826
if (hierarchy_) {
827
- size_t last_idx = name.find_last_of('/');
+ size_t last_idx = std::string::npos;
828
+ size_t pos = name.length();
829
+ while ((pos = name.rfind('/', pos)) != std::string::npos) {
830
+ if (pos > 0 && name[pos - 1] == '\\') {
831
+ // This is an escaped slash, so we should ignore it and continue
832
+ // searching.
833
+ pos--;
834
+ } else {
835
+ last_idx = pos;
836
+ break;
837
+ }
838
839
if (last_idx != std::string::npos) {
840
name = name.substr(last_idx + 1);
841
0 commit comments