From b9c0d4415b8cd6135321185b6febfdd1366a477c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 8 Oct 2010 03:09:25 +0200 Subject: systemctl: fix 'systemctl enable getty@.service' --- src/unit-name.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/unit-name.c') 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, '.')); -- cgit v1.2.3-54-g00ecf