Revision: 468 http://trac.macosforge.org/projects/darwinbuild/changeset/468 Author: wsiegrist@apple.com Date: 2009-01-27 18:26:46 -0800 (Tue, 27 Jan 2009) Log Message: ----------- Only calculate numfiles once. Improve the comment. Modified Paths: -------------- branches/PR-6497694/darwinup/Depot.cpp Modified: branches/PR-6497694/darwinup/Depot.cpp =================================================================== --- branches/PR-6497694/darwinup/Depot.cpp 2009-01-28 02:20:36 UTC (rev 467) +++ branches/PR-6497694/darwinup/Depot.cpp 2009-01-28 02:26:46 UTC (rev 468) @@ -425,7 +425,8 @@ // XXX: res = file->backup() - // Copy libraries gnutar uses since we need to use gnutar before they are replaced + // copy files used by gnutar and libarchive instead of moving them + // since we use tar during the archive process size_t i = 0; bool docopy = false; const char* tarfiles[] = {"/usr/bin/tar", @@ -437,7 +438,8 @@ "/usr/lib/libSystem.B.dylib", "/usr/lib/libiconv.2.dylib", "/usr/lib/libgcc_s.1.dylib"}; - for (i = 0; i < sizeof(tarfiles)/sizeof(*tarfiles); i++) { + size_t numfiles = sizeof(tarfiles)/sizeof(*tarfiles); + for (i = 0; i < numfiles; i++) { if (strncmp(tarfiles[i], file->path(), strlen(tarfiles[i])) == 0) { docopy = true; break;