Make config file modification detection a bit more readable
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Apr 2012 13:27:08 +0000 (16:27 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Apr 2012 13:28:43 +0000 (16:28 +0300)
lib/transaction.c

index 68461d4..4ff2646 100644 (file)
@@ -539,8 +539,9 @@ assert(otherFi != NULL);
                const unsigned char *digest;
                if ((digest = rpmfiFDigest(fi, &algo, &diglen))) {
                    unsigned char fdigest[diglen];
-                   if (!rpmDoDigest(algo, fn, 0, fdigest, NULL) &&
-                       memcmp(digest, fdigest, diglen)) {
+                   int modified = (!rpmDoDigest(algo, fn, 0, fdigest, NULL) &&
+                                   memcmp(digest, fdigest, diglen));
+                   if (modified) {
                        rpmfsSetAction(fs, i, FA_BACKUP);
                        break;
                    }