mask && PFM_FOO should instead be mask & PFM_FOO.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 15 Sep 2010 00:05:24 +0000 (00:05 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 15 Sep 2010 00:05:24 +0000 (00:05 +0000)
From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.

git-svn-id: http://opkg.googlecode.com/svn/trunk@564 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/pkg_parse.c

index 2ce696fd586981f90c939de8982f2e3702314089..5d08177bf9fcce8a25b31fe3f2d5e7c3ae5376b3 100644 (file)
@@ -222,11 +222,11 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
                break;
 
        case 'I':
-               if ((mask && PFM_INSTALLED_SIZE) && is_field("Installed-Size", line)) {
+               if ((mask & PFM_INSTALLED_SIZE) && is_field("Installed-Size", line)) {
                        char *tmp = parse_simple("Installed-Size", line);
                        pkg->installed_size = strtoul(tmp, NULL, 0);
                        free (tmp);
-               } else if ((mask && PFM_INSTALLED_TIME) && is_field("Installed-Time", line)) {
+               } else if ((mask & PFM_INSTALLED_TIME) && is_field("Installed-Time", line)) {
                        char *tmp = parse_simple("Installed-Time", line);
                        pkg->installed_time = strtoul(tmp, NULL, 0);
                        free (tmp);
@@ -234,14 +234,13 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
                break;
 
        case 'M':
-               if (mask && PFM_MD5SUM) {
-                       if (is_field("MD5sum:", line))
-                               pkg->md5sum = parse_simple("MD5sum", line);
+               if ((mask & PFM_MD5SUM) && is_field("MD5sum:", line))
+                       pkg->md5sum = parse_simple("MD5sum", line);
                        /* The old opkg wrote out status files with the wrong
                        * case for MD5sum, let's parse it either way */
-                       else if (is_field("MD5Sum:", line))
-                               pkg->md5sum = parse_simple("MD5Sum", line);
-               else if((mask & PFM_MAINTAINER) && is_field("Maintainer", line))
+               else if ((mask & PFM_MD5SUM) && is_field("MD5Sum:", line)) 
+                       pkg->md5sum = parse_simple("MD5Sum", line);
+               else if((mask & PFM_MAINTAINER) && is_field("Maintainer", line))
                        pkg->maintainer = parse_simple("Maintainer", line);
                break;
 
@@ -301,7 +300,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
                        strcat(pkg->description, "\n");
                        strcat(pkg->description, (line));
                        goto dont_reset_flags;
-               } else if ((mask && PFM_CONFFILES) && reading_conffiles) {
+               } else if ((mask & PFM_CONFFILES) && reading_conffiles) {
                        parse_conffiles(pkg, line);
                        goto dont_reset_flags;
                }