mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
service: sysv - properly handle init scripts with .sh suffix
Dropping the distribution specific #ifdefs in
88516c0c95
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.
This commit is contained in:
parent
9304ef91c5
commit
11dac832c7
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue