From 207da7ffcf52352cf71090cd7e4e7881816618f1 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 1 Mar 2021 19:41:01 -0500 Subject: Skip leading whitespace on prepends and commands --- daemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon.c b/daemon.c index f36e277..1bab9ef 100644 --- a/daemon.c +++ b/daemon.c @@ -70,7 +70,8 @@ static int parseConfig(const char *path) { if (!ptr[0] || ptr[0] == '#') { continue; } else if (ptr[0] == '%') { - int error = prependAdd(&ptr[1]); + ptr++; + int error = prependAdd(&ptr[strspn(ptr, WS)]); if (error) { syslog(LOG_WARNING, "cannot add prepend command: %m"); goto err; @@ -84,7 +85,7 @@ static int parseConfig(const char *path) { ); goto err; } - int error = serviceAdd(name, ptr); + int error = serviceAdd(name, &ptr[strspn(ptr, WS)]); if (error) { syslog(LOG_WARNING, "cannot add service: %m"); goto err; -- cgit 1.4.1