summaryrefslogtreecommitdiff
path: root/src/unit-name.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-08 03:09:25 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-08 03:09:25 +0200
commitb9c0d4415b8cd6135321185b6febfdd1366a477c (patch)
treec322309e262ea7c49c0ebe06ad0a52d8268c2dad /src/unit-name.c
parentf34277d9117cd9d858f7332eef0023e05277ce74 (diff)
systemctl: fix 'systemctl enable getty@.service'
Diffstat (limited to 'src/unit-name.c')
-rw-r--r--src/unit-name.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unit-name.c b/src/unit-name.c
index 0e86b554c2..cd6e3cea5c 100644
--- a/src/unit-name.c
+++ b/src/unit-name.c
@@ -32,7 +32,7 @@
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
":-_.\\"
-bool unit_name_is_valid_no_type(const char *n) {
+bool unit_name_is_valid_no_type(const char *n, bool template_ok) {
const char *e, *i, *at;
/* Valid formats:
@@ -63,7 +63,7 @@ bool unit_name_is_valid_no_type(const char *n) {
if (at == n)
return false;
- if (at[1] == '.')
+ if (!template_ok && at+1 == e)
return false;
}
@@ -150,7 +150,7 @@ char *unit_name_change_suffix(const char *n, const char *suffix) {
size_t a, b;
assert(n);
- assert(unit_name_is_valid_no_type(n));
+ assert(unit_name_is_valid_no_type(n, true));
assert(suffix);
assert_se(e = strrchr(n, '.'));