From 783e2dc0b424afdf0a5d2add368279cb63016897 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 17 Apr 2019 13:48:54 +0300 Subject: [PATCH] Port parseSimpleScript() to use parseLines(), no functional changes --- build/parseSimpleScript.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/build/parseSimpleScript.c b/build/parseSimpleScript.c index e8cc6266e..efc37153b 100644 --- a/build/parseSimpleScript.c +++ b/build/parseSimpleScript.c @@ -11,7 +11,7 @@ int parseSimpleScript(rpmSpec spec, const char * name, StringBuf *sbp) { - int nextPart, rc, res = PART_ERROR; + int res = PART_ERROR; if (*sbp != NULL) { rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), @@ -19,26 +19,8 @@ int parseSimpleScript(rpmSpec spec, const char * name, StringBuf *sbp) goto exit; } - *sbp = newStringBuf(); - /* There are no options to %build, %install, %check, or %clean */ - if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { - res = PART_NONE; - goto exit; - } else if (rc < 0) { - goto exit; - } - - while (! (nextPart = isPart(spec->line))) { - appendStringBuf(*sbp, spec->line); - if ((rc = readLine(spec, STRIP_NOTHING)) > 0) { - nextPart = PART_NONE; - break; - } else if (rc < 0) { - goto exit; - } - } - res = nextPart; + res = parseLines(spec, STRIP_NOTHING, NULL, sbp); exit: