summaryrefslogtreecommitdiffstats
path: root/src/libs/shared/Store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/shared/Store.cpp')
-rw-r--r--src/libs/shared/Store.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libs/shared/Store.cpp b/src/libs/shared/Store.cpp
index fea18b6d..9f0f3624 100644
--- a/src/libs/shared/Store.cpp
+++ b/src/libs/shared/Store.cpp
@@ -82,7 +82,8 @@ Store::find_child(SharedPtr<Shared::GraphObject> parent, const string& child_nam
unsigned
Store::child_name_offset(const Raul::Path& parent,
- const Raul::Symbol& symbol)
+ const Raul::Symbol& symbol,
+ bool allow_zero)
{
unsigned offset = 0;
@@ -91,7 +92,7 @@ Store::child_name_offset(const Raul::Path& parent,
ss << symbol;
if (offset > 0)
ss << "_" << offset;
- if (find(parent.base() + ss.str()) == end())
+ if (find(parent.base() + ss.str()) == end() && (allow_zero || offset > 0))
break;
else if (offset == 0)
offset = 2;