Skip leading whitespace on prepends and commands

This commit is contained in:
C. McEnroe 2021-03-01 19:41:01 -05:00
parent e9901e30a2
commit 207da7ffcf
1 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,8 @@ static int parseConfig(const char *path) {
if (!ptr[0] || ptr[0] == '#') { if (!ptr[0] || ptr[0] == '#') {
continue; continue;
} else if (ptr[0] == '%') { } else if (ptr[0] == '%') {
int error = prependAdd(&ptr[1]); ptr++;
int error = prependAdd(&ptr[strspn(ptr, WS)]);
if (error) { if (error) {
syslog(LOG_WARNING, "cannot add prepend command: %m"); syslog(LOG_WARNING, "cannot add prepend command: %m");
goto err; goto err;
@ -84,7 +85,7 @@ static int parseConfig(const char *path) {
); );
goto err; goto err;
} }
int error = serviceAdd(name, ptr); int error = serviceAdd(name, &ptr[strspn(ptr, WS)]);
if (error) { if (error) {
syslog(LOG_WARNING, "cannot add service: %m"); syslog(LOG_WARNING, "cannot add service: %m");
goto err; goto err;