Просмотр исходного кода

CTest: Clear custom vectors before populating (#12383)

Important when calling ctest commands in a loop from a script.
Each time Populate gets called, it uses the current definition
of the variable. Without the clear, it was accumulating additional
identical values each time through the loop.
David Cole 14 лет назад
Родитель
Сommit
499c104572
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      Source/cmCTest.cxx

+ 2 - 0
Source/cmCTest.cxx

@@ -2526,6 +2526,8 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
   cmSystemTools::ExpandListArgument(dval, slist);
   std::vector<std::string>::iterator it;
 
+  vec.clear();
+
   for ( it = slist.begin(); it != slist.end(); ++it )
     {
     cmCTestLog(this, DEBUG, "  -- " << it->c_str() << std::endl);