From 1e3db59b568b1ff7f7e1f3285fc9b18567f2f2d6 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 28 Oct 2010 09:54:53 +0300 Subject: [PATCH] Eliminate splitString() leftover braindamage in processSourceFiles() - Collect the filenames directly into the ARGV_t files instead of putting them to a StringBuf first and then argvSplit()'ing the result, doh. Leftover stupidity from eliminating splitString() usage in commit 94ff22b129aeb31c38848231e40f87aa4a5613a1 --- build/files.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/build/files.c b/build/files.c index 1627d39..9d9e283 100644 --- a/build/files.c +++ b/build/files.c @@ -1950,10 +1950,8 @@ static void genSourceRpmName(rpmSpec spec) rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) { struct Source *srcPtr; - StringBuf sourceFiles; int x, isSpec = 1; struct FileList_s fl; - char *s, **fp; ARGV_t files = NULL; Package pkg; static char *_srcdefattr; @@ -1965,15 +1963,14 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) _srcdefattr = _free(_srcdefattr); oneshot = 1; } - sourceFiles = newStringBuf(); genSourceRpmName(spec); /* Construct the file list and source entries */ - appendLineStringBuf(sourceFiles, spec->specFile); + argvAdd(&files, spec->specFile); for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { char * sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), "%{_sourcedir}/", srcPtr->source, NULL); - appendLineStringBuf(sourceFiles, sfn); + argvAdd(&files, sfn); sfn = _free(sfn); } @@ -1982,7 +1979,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) char * sfn; sfn = rpmGetPath( ((srcPtr->flags & RPMBUILD_ISNO) ? "!" : ""), "%{_sourcedir}/", srcPtr->source, NULL); - appendLineStringBuf(sourceFiles, sfn); + argvAdd(&files, sfn); sfn = _free(sfn); } } @@ -2002,17 +1999,13 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) fl.pkgFlags = pkgFlags; fl.buildRoot = NULL; - s = getStringBuf(sourceFiles); - argvSplit(&files, s, "\n"); - /* The first source file is the spec file */ x = 0; - for (fp = files; *fp != NULL; fp++) { - const char *diskPath; + for (ARGV_const_t fp = files; *fp != NULL; fp++) { + const char *diskPath = *fp; char *tmp; FileListRec flp; - diskPath = *fp; SKIPSPACE(diskPath); if (! *diskPath) continue; @@ -2071,7 +2064,6 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) spec->sourceHeader, 1); } - sourceFiles = freeStringBuf(sourceFiles); fl.fileList = freeFileList(fl.fileList, fl.fileListRecsUsed); freeAttrRec(&fl.def_ar); return fl.processingFailed ? RPMRC_FAIL : RPMRC_OK; -- 2.7.4