summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarak Sason <bsasonro@redhat.com>2019-08-20 15:37:16 +0300
committerAtin Mukherjee <amukherj@redhat.com>2019-08-25 05:18:33 +0000
commit30e83561b8dcced2593deb904688177fcd4ff0e0 (patch)
treee60b06d94224c46597d8838ba56881d0652476fe
parent7afea5eeef61d3f29496b15ba54defeb39161588 (diff)
cli - group files to set volume options supports comments
Modified parsing of group files in such a way that line that starts with "#" would be treated as comments Fixes: bz#1423442 Change-Id: Id85ceb49f8f9c920d4ea551f60bd28767279d4be Signed-off-by: Barak Sason <bsasonro@redhat.com>
-rw-r--r--cli/src/cli-cmd-parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 18aef21..8379a2c 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1622,6 +1622,11 @@ cli_add_key_group(dict_t *dict, char *key, char *value, char **op_errstr)
}
goto out;
}
+
+ /* Treat line that start with "#" as comments */
+ if ('#' == line[0])
+ continue;
+
opt_count++;
tok_key = strtok_r(line, "=", &saveptr);
tok_val = strtok_r(NULL, "\r\n", &saveptr);