summaryrefslogtreecommitdiff
path: root/package/system/opkg/patches
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2013-10-14 08:09:58 +0000
committerSteven Barth <cyrus@openwrt.org>2013-10-14 08:09:58 +0000
commitcde419ebfc0887286662288c15afe3ef442c4bf4 (patch)
treebbe160b56e5dc295f69cd5cd9b0eccc2cf33cfd8 /package/system/opkg/patches
parent232a654833d1f968bc686d923d20769ec210142c (diff)
downloadmtk-20170518-cde419ebfc0887286662288c15afe3ef442c4bf4.zip
mtk-20170518-cde419ebfc0887286662288c15afe3ef442c4bf4.tar.gz
mtk-20170518-cde419ebfc0887286662288c15afe3ef442c4bf4.tar.bz2
opkg: ignore empty fields in package lists
This is to work around issues with package list generators creating empty fields in some environments. Based on a patch by Paul Selkrik <pselkrik@isc.org> Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 38390
Diffstat (limited to 'package/system/opkg/patches')
-rw-r--r--package/system/opkg/patches/080-suppress-blank-package-fields.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/package/system/opkg/patches/080-suppress-blank-package-fields.patch b/package/system/opkg/patches/080-suppress-blank-package-fields.patch
new file mode 100644
index 0000000..976b97d
--- /dev/null
+++ b/package/system/opkg/patches/080-suppress-blank-package-fields.patch
@@ -0,0 +1,16 @@
+--- a/libopkg/parse_util.c
++++ b/libopkg/parse_util.c
+@@ -35,7 +35,12 @@ is_field(const char *type, const char *l
+ 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;
+ }
+
+ /*