- Turn the strange negated condition around: when dealing with
config files test for it directly. This way, all the special
cases are handled first and normal cases fall through the if-jungle
to exactly one case of rpmfsSetAction(fs, i, FA_ERASE). Makes
the logic more obvious, at least to me.
break;
if (rpmfiFState(fi) != RPMFILE_STATE_NORMAL)
break;
- if (!(S_ISREG(FMode) && (FFlags & RPMFILE_CONFIG))) {
- rpmfsSetAction(fs, i, FA_ERASE);
- break;
- }
- /* Here is a pre-existing modified config file that needs saving. */
- { int algo = 0;
+ /* Pre-existing modified config files need to be saved. */
+ if (S_ISREG(FMode) && (FFlags & RPMFILE_CONFIG)) {
+ int algo = 0;
size_t diglen = 0;
const unsigned char *digest;
if ((digest = rpmfiFDigest(fi, &algo, &diglen))) {
}
}
}
+
+ /* Otherwise, we can just erase. */
rpmfsSetAction(fs, i, FA_ERASE);
break;
}