summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-20 17:12:42 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-20 17:12:42 +0200
commitafe87974dd57741f74dd87165b251886f24c859f (patch)
tree48689b923f71809aa3a010b2fd9effe782b1cc87 /src/libsystemd
parenta136c2cdd84c93c2fa5e1cedb20f5acac80df5be (diff)
downloadsystemd-afe87974dd57741f74dd87165b251886f24c859f.tar.gz
sd-hwdb: allow empty properties
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.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-hwdb/hwdb-util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c
index 1b642b6851..c2bfcd1d42 100644
--- a/src/libsystemd/sd-hwdb/hwdb-util.c
+++ b/src/libsystemd/sd-hwdb/hwdb-util.c
@@ -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)