From 11dac832c75cbdd0015fb0417b9877396ea57f6f Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 6 Mar 2013 23:24:31 +0100 Subject: 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. --- src/core/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') 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 -- cgit v1.2.3-54-g00ecf