Port parsePolicies() to use parseLines(), no functional changes

This commit is contained in:
Panu Matilainen 2019-04-17 13:47:52 +03:00 committed by Florian Festi
parent eb0487b00f
commit bc0ad090ed
1 changed files with 3 additions and 17 deletions

View File

@ -14,7 +14,7 @@
int parsePolicies(rpmSpec spec) int parsePolicies(rpmSpec spec)
{ {
int nextPart, res = PART_ERROR; int res = PART_ERROR;
Package pkg; Package pkg;
int rc, argc; int rc, argc;
int arg; int arg;
@ -61,22 +61,8 @@ int parsePolicies(rpmSpec spec)
if (lookupPackage(spec, name, flag, &pkg)) if (lookupPackage(spec, name, flag, &pkg))
goto exit; goto exit;
if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { res = parseLines(spec, (STRIP_TRAILINGSPACE | STRIP_COMMENTS),
nextPart = PART_NONE; &(pkg->policyList), NULL);
} else if (rc < 0) {
goto exit;
} else {
while (!(nextPart = isPart(spec->line))) {
argvAdd(&(pkg->policyList), spec->line);
if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) {
nextPart = PART_NONE;
break;
} else if (rc < 0) {
goto exit;
}
}
}
res = nextPart;
exit: exit:
free(argv); free(argv);