From 30e83561b8dcced2593deb904688177fcd4ff0e0 Mon Sep 17 00:00:00 2001 From: Barak Sason Date: Tue, 20 Aug 2019 15:37:16 +0300 Subject: 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 --- cli/src/cli-cmd-parser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 18aef217a9a..8379a2cb4c1 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); -- cgit