pkg_parse: remove unused variable in pkg_parse_line()
[project/opkg-lede.git] / libopkg / pkg_parse.c
index 7f46dc51f8c40f20aeeab01a8df2fb5c23ce9517..057f68b1753d7a3f5a836eb86b3f321e75a6fa47 100644 (file)
@@ -112,15 +112,15 @@ static char *parse_architecture(pkg_t *pkg, const char *str)
        return pkg_set_architecture(pkg, s, e - s);
 }
 
-int pkg_parse_line(void *ptr, const char *line, uint mask)
+int pkg_parse_line(void *ptr, char *line, uint mask)
 {
        pkg_t *pkg = (pkg_t *) ptr;
        abstract_pkg_t *ab_pkg = NULL;
+       conffile_list_t *cl;
 
        /* these flags are a bit hackish... */
        static int reading_conffiles = 0, reading_description = 0;
        static char *description = NULL;
-       char *s;
        int ret = 0;
 
        /* Exclude globally masked fields. */
@@ -146,6 +146,11 @@ int pkg_parse_line(void *ptr, const char *line, uint mask)
                if ((mask & PFM_CONFFILES) && is_field("Conffiles", line)) {
                        reading_conffiles = 1;
                        reading_description = 0;
+
+                       cl = xcalloc(1, sizeof(*cl));
+                       conffile_list_init(cl);
+                       pkg_set_ptr(pkg, PKG_CONFFILES, cl);
+
                        goto dont_reset_flags;
                } else if ((mask & PFM_CONFLICTS)
                           && is_field("Conflicts", line))