summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-01-21 21:51:20 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-01-22 15:30:37 +0100
commit9ae1935b74cc2336a19bcaee8703f6d22d1ee837 (patch)
tree1d9d2d8141398a6bb1849d00e26b7bb9b2432e99 /lib/config
parent74adbec77f77cd725bbac7ab3f3fb964d8b1e1f0 (diff)
downloadlvm2-9ae1935b74cc2336a19bcaee8703f6d22d1ee837.tar.gz
config: avoid printing spaces before end of line
Empty comments were generating unnecessary space char before new line.
Diffstat (limited to 'lib/config')
-rw-r--r--lib/config/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/config/config.c b/lib/config/config.c
index a25b7db6e..f9ca56677 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1738,7 +1738,7 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
continue;
commentline[0] = '\0';
}
- fprintf(out->fp, "%s# %s\n", line, commentline);
+ fprintf(out->fp, "%s#%s%s\n", line, commentline[0] ? " " : "", commentline);
/* withsummary prints only the first comment line. */
if (!out->tree_spec->withcomments)
break;