diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 10:46:43 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 10:46:43 +0300 |
commit | 64527b4dafec9064f2964dbef949a5af3854636d (patch) | |
tree | 5456295a512b40c9c92f96f4d0b26498b907e82e | |
parent | 6e0450da248157ae0c88fbd6ffba842cd461c9f2 (diff) | |
download | rpm-64527b4dafec9064f2964dbef949a5af3854636d.tar.gz rpm-64527b4dafec9064f2964dbef949a5af3854636d.tar.bz2 rpm-64527b4dafec9064f2964dbef949a5af3854636d.zip |
Make parseDescription() return PART_ERROR on errors
-rw-r--r-- | build/parseDescription.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/build/parseDescription.c b/build/parseDescription.c index c3529d449..66f6a0d2c 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -24,7 +24,7 @@ extern int noLang; int parseDescription(rpmSpec spec) { - int nextPart = RPMRC_FAIL; /* assume error */ + int nextPart = PART_ERROR; /* assume error */ StringBuf sb; int flag = PART_SUBNAME; Package pkg; @@ -40,7 +40,7 @@ int parseDescription(rpmSpec spec) if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%description: %s\n"), spec->lineNum, poptStrerror(rc)); - return RPMRC_FAIL; + return PART_ERROR; } optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); @@ -92,11 +92,10 @@ int parseDescription(rpmSpec spec) if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { nextPart = PART_NONE; - } else { - if (rc) { - nextPart = RPMRC_FAIL; + } else if (rc < 0) { + nextPart = PART_ERROR; goto exit; - } + } else { while (! (nextPart = isPart(spec->line))) { appendLineStringBuf(sb, spec->line); if (t) t->t_nlines++; @@ -104,9 +103,8 @@ int parseDescription(rpmSpec spec) readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { nextPart = PART_NONE; break; - } - if (rc) { - nextPart = RPMRC_FAIL; + } else if (rc < 0) { + nextPart = PART_ERROR; goto exit; } } |