summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2019-01-18 08:01:10 +0000
committerJo-Philipp Wich2019-01-18 08:01:10 +0000
commit1504d35f123980bf322df99fb434f6fda6e3ecd2 (patch)
tree1b36a32e75eb11228e838e98cbdf6606f75eb3ac
parentd217daf1b32d88a48659155b1faf747982175c5d (diff)
downloadopkg-lede-1504d35f123980bf322df99fb434f6fda6e3ecd2.tar.gz
libopkg: accept alternative notation for "Replaces" control field
The presence of a "Replaces:" tag in any package feed list will cause opkg prior to "d217daf libopkg: fix replacelist parsing and writing" to segfault while parsing such a list. Add a hack which lets opkg recognize a "Replace2" field and handle it identically to "Replaces". Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--libopkg/pkg_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
index 0baa4db..f6199da 100644
--- a/libopkg/pkg_parse.c
+++ b/libopkg/pkg_parse.c
@@ -302,7 +302,7 @@ int pkg_parse_line(void *ptr, char *line, uint mask)
case 'R':
if ((mask & PFM_RECOMMENDS) && is_field("Recommends", line))
parse_deplist(pkg, RECOMMEND, line + strlen("Recommends") + 1);
- else if ((mask & PFM_REPLACES) && is_field("Replaces", line))
+ else if ((mask & PFM_REPLACES) && (is_field("Replaces", line) || is_field("Replace2", line)))
parse_replacelist(pkg, line + strlen("Replaces") + 1);
break;