1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

config: avoid printing spaces before end of line

Empty comments were generating unnecessary space char before new line.
This commit is contained in:
Zdenek Kabelac 2021-01-21 21:51:20 +01:00
parent 74adbec77f
commit 9ae1935b74
3 changed files with 75 additions and 75 deletions

View File

@ -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;