diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-28 21:58:26 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-28 21:58:26 +0300 |
commit | 4201d351b44deea108bffa74ca61d4aa4c0a611e (patch) | |
tree | c0c2d15fd8bfe51d2f0862f7aa88baf76c1a051d /build/files.c | |
parent | a0797f0237e42556400f7107108f1687bcf097e2 (diff) | |
download | librpm-tizen-4201d351b44deea108bffa74ca61d4aa4c0a611e.tar.gz librpm-tizen-4201d351b44deea108bffa74ca61d4aa4c0a611e.tar.bz2 librpm-tizen-4201d351b44deea108bffa74ca61d4aa4c0a611e.zip |
Allocate buffer for %doc filenames dynamically
Diffstat (limited to 'build/files.c')
-rw-r--r-- | build/files.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/build/files.c b/build/files.c index 10040c423..e6f5de057 100644 --- a/build/files.c +++ b/build/files.c @@ -837,10 +837,9 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, FileList fl, const char ** fileName) { char *s, *t; - int res, specialDoc = 0; - char specialDocBuf[BUFSIZ]; + int res; + char *specialDocBuf = NULL; - specialDocBuf[0] = '\0'; *fileName = NULL; res = RPMRC_OK; @@ -887,9 +886,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, if (*s != '/') { if (fl->currentFlags & RPMFILE_DOC) { - specialDoc = 1; - strcat(specialDocBuf, " "); - strcat(specialDocBuf, s); + rstrscat(&specialDocBuf, " ", s, NULL); } else if (fl->currentFlags & (RPMFILE_POLICY|RPMFILE_PUBKEY|RPMFILE_ICON)) { @@ -904,7 +901,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, } } - if (specialDoc) { + if (specialDocBuf) { if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) { rpmlog(RPMLOG_ERR, _("Can't mix special %%doc with other forms: %s\n"), @@ -952,6 +949,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, appendStringBuf(pkg->specialDoc, specialDocBuf); appendLineStringBuf(pkg->specialDoc, " $DOCDIR"); } + free(specialDocBuf); } if (res != RPMRC_OK) { |