util: introduce fputs_with_space() and make use of it at various places

The call combines outputing a string with prefixing it with a space, optionally. This is useful to shorten the logic
for outputing lists of strings, that are space separated.
This commit is contained in:
Lennart Poettering
2016-01-26 14:42:04 +01:00
parent b2a81c0b52
commit d390f8ef2d
5 changed files with 46 additions and 49 deletions
+2
View File
@@ -82,3 +82,5 @@ int tempfn_random_child(const char *p, const char *extra, char **ret);
int write_timestamp_file_atomic(const char *fn, usec_t n);
int read_timestamp_file(const char *fn, usec_t *ret);
int fputs_with_space(FILE *f, const char *s, const char *separator, bool *space);