summaryrefslogtreecommitdiff
path: root/src/shared/unit-name.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/unit-name.c')
-rw-r--r--src/shared/unit-name.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index fcf5902c78..e8328c321a 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -341,6 +341,18 @@ bool unit_name_is_template(const char *n) {
return p[1] == '.';
}
+bool unit_name_is_instance(const char *n) {
+ const char *p;
+
+ assert(n);
+
+ p = strchr(n, '@');
+ if (!p)
+ return false;
+
+ return p[1] != '.';
+}
+
char *unit_name_replace_instance(const char *f, const char *i) {
const char *p, *e;
char *r, *k;