mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Allow comments and empty lines in properties files
Lines with '#' as first character are treated as comments, and are skipped. Empty lines are also skipped. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
b1997c7aac
commit
52b6e57743
@@ -386,8 +386,12 @@ int properties_load(struct properties *properties, const char *filename,
|
||||
|
||||
while (fgets(line, sizeof(line), fp) != NULL) {
|
||||
len = strlen(line);
|
||||
if (line[len-1] == '\n')
|
||||
line[len-1] = '\0';
|
||||
if (line[len - 1] == '\n')
|
||||
line[len - 1] = '\0';
|
||||
if (line[0] == '#')
|
||||
continue;
|
||||
if (strlen(line) == 0)
|
||||
continue;
|
||||
ch = strchr(line, '=');
|
||||
if (ch == NULL) {
|
||||
rc = -EPERM;
|
||||
|
||||
Reference in New Issue
Block a user