Skip to content

Commit

Permalink
sd-hwdb: allow empty properties
Browse files Browse the repository at this point in the history
So far we didn't allow empty properties, but it makes sense to do so, for
example to distinguish empty data from lack of data. It also makes it easy to
override properties (back to the empty) value for specific cases.
  • Loading branch information
keszybz committed Oct 20, 2020
1 parent a136c2c commit afe8797
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libsystemd/sd-hwdb/hwdb-util.c
Expand Up @@ -456,10 +456,9 @@ static int insert_data(struct trie *trie, char **match_list, char *line, const c
while (isblank(line[0]) && isblank(line[1]))
line++;

if (isempty(line + 1) || isempty(value))
if (isempty(line + 1))
return log_syntax(NULL, LOG_WARNING, filename, line_number, SYNTHETIC_ERRNO(EINVAL),
"Empty %s in \"%s=%s\", ignoring",
isempty(line + 1) ? "key" : "value",
"Empty key in \"%s=%s\", ignoring",
line, value);

STRV_FOREACH(entry, match_list)
Expand Down

0 comments on commit afe8797

Please sign in to comment.