diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 11:27:49 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-05 11:27:49 +0300 |
commit | 557c2673f7e7ff222f8abcc35ecd601007374b6f (patch) | |
tree | 3dc4c7e3de6d41bf9a1808c3c7eebe6580ff6b50 | |
parent | 3c5f581df6be0776b1d49e94d518c58e93a886c2 (diff) | |
download | rpm-557c2673f7e7ff222f8abcc35ecd601007374b6f.tar.gz rpm-557c2673f7e7ff222f8abcc35ecd601007374b6f.tar.bz2 rpm-557c2673f7e7ff222f8abcc35ecd601007374b6f.zip |
Fix (hopefully ;) signaling for line continuations on spec parsing
-rw-r--r-- | build/parseSpec.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/build/parseSpec.c b/build/parseSpec.c index 3ee4649cf..54465e270 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -127,6 +127,7 @@ static int restoreFirstChar(rpmSpec spec) return 0; } +/* Return zero on success, 1 if we need to read more and -1 on errors. */ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) { char ch; @@ -169,11 +170,10 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) } } - /* If it doesn't, ask for one more line. We need a better - * error code for this. */ + /* If it doesn't, ask for one more line. */ if (pc || bc || nc ) { spec->nextline = ""; - return RPMRC_FAIL; + return 1; } spec->lbufPtr = spec->lbuf; @@ -182,7 +182,7 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) { rpmlog(RPMLOG_ERR, _("line %d: %s\n"), spec->lineNum, spec->lbuf); - return RPMRC_FAIL; + return -1; } spec->nextline = spec->lbuf; } @@ -285,10 +285,11 @@ int readLine(rpmSpec spec, int strip) return rc; /* Copy next file line into the spec line buffer */ - if ((rc = copyNextLineFromOFI(spec, ofi)) != 0) { - if (rc == RPMRC_FAIL) - goto retry; - return rc; + rc = copyNextLineFromOFI(spec, ofi); + if (rc > 0) { + goto retry; + } else if (rc < 0) { + return PART_ERROR; } } |