summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-03-06 23:24:31 +0100
committerMichael Biebl <biebl@debian.org>2013-03-06 23:24:31 +0100
commit11dac832c75cbdd0015fb0417b9877396ea57f6f (patch)
tree9e9dc5b69f5bcb8c076140ba9ec86089e019b825 /src/core/service.c
parent9304ef91c563263cfd914fb32b6ca118bf60d60e (diff)
service: sysv - properly handle init scripts with .sh suffix
Dropping the distribution specific #ifdefs in 88516c0c952b9502e8ef1d6a1481af61b0fb422d broke the .sh suffix stripping since we now always used the else clause of the rc. check. We eventually want to drop the rc. prefix stripping, but for now we assume that no sysv init script uses both an rc. prefix and .sh suffix, so make the check for the .sh suffix and rc. prefix mutually exclusive.
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 61b150cba8..3fbb0a136d 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -331,7 +331,7 @@ static char *sysv_translate_name(const char *name) {
if (endswith(name, ".sh"))
/* Drop .sh suffix */
strcpy(stpcpy(r, name) - 3, ".service");
- if (startswith(name, "rc."))
+ else if (startswith(name, "rc."))
/* Drop rc. prefix */
strcpy(stpcpy(r, name + 3), ".service");
else