projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
libopkg: discard empty control file fields
[oweals/opkg-lede.git]
/
libopkg
/
parse_util.c
diff --git
a/libopkg/parse_util.c
b/libopkg/parse_util.c
index fbecba6eb700954b811c6e09a712e02a00cee2f7..2aef7a9cce0544790a782f1266be946add44a3da 100644
(file)
--- a/
libopkg/parse_util.c
+++ b/
libopkg/parse_util.c
@@
-35,7
+35,12
@@
is_field(const char *type, const char *line)
char *
parse_simple(const char *type, const char *line)
{
- return trim_xstrdup(line + strlen(type) + 1);
+ char *field = trim_xstrdup(line + strlen(type) + 1);
+ if (strlen(field) == 0) {
+ free(field);
+ return NULL;
+ }
+ return field;
}
/*