From c1faafcad8197a821282b8e56a10132e27eb5d9f Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 13 Mar 2015 12:34:29 -0400 Subject: start-stop-daemon: Fix regression for --test The previous fix to --test (PR #34) prevented reading one too many arguments when --exec -or --name was not specified, but created a regression where the last argument would not print if either of those arguments was specified. This corrects the issue. Fixes #41. --- src/rc/start-stop-daemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 3afbf2e8..7919835b 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -919,10 +919,13 @@ start_stop_daemon(int argc, char **argv) exec = name; if (name && start) *argv = name; - } else if (name) + } else if (name) { *--argv = name; - else if (exec) + ++argc; + } else if (exec) { *--argv = exec; + ++argc; + }; if (stop || sig != -1) { if (sig == -1) -- cgit v1.2.3