mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
config: recognize a blank comment line
Consider the comment line "#\n" to be a blank line, and print a blank line at that position when --withspaces is set.
This commit is contained in:
parent
5243a81c29
commit
ca70770cfd
@ -1695,6 +1695,11 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
|
||||
if (cfg_def->comment) {
|
||||
int pos = 0;
|
||||
while (_copy_one_line(cfg_def->comment, commentline, &pos, strlen(cfg_def->comment))) {
|
||||
if ((commentline[0] == '#') && (strlen(commentline) == 1)) {
|
||||
if (!out->tree_spec->withspaces)
|
||||
continue;
|
||||
commentline[0] = '\0';
|
||||
}
|
||||
fprintf(out->fp, "%s# %s\n", line, commentline);
|
||||
/* withsummary prints only the first comment line. */
|
||||
if (!out->tree_spec->withcomments)
|
||||
|
Loading…
Reference in New Issue
Block a user