[Cmake-commits] [cmake-commits] hoffman committed cmListCommand.cxx 1.22 1.23

cmake-commits at cmake.org cmake-commits at cmake.org
Tue May 20 11:30:32 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv24319

Modified Files:
	cmListCommand.cxx 
Log Message:
BUG: fix bugs in new style list command that handles empty stuff


Index: cmListCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListCommand.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -C 2 -d -r1.22 -r1.23
*** cmListCommand.cxx	7 May 2008 18:57:29 -0000	1.22
--- cmListCommand.cxx	20 May 2008 15:30:30 -0000	1.23
***************
*** 213,223 ****
    std::string value;
    size_t cc;
    for ( cc = 2; cc < args.size()-1; cc ++ )
      {
      int item = atoi(args[cc].c_str());
!     if (value.size())
!       {
!       value += ";";
!       }
      size_t nitem = varArgsExpanded.size();
      if ( item < 0 )
--- 213,222 ----
    std::string value;
    size_t cc;
+   const char* sep = "";
    for ( cc = 2; cc < args.size()-1; cc ++ )
      {
      int item = atoi(args[cc].c_str());
!     value += sep;
!     sep = ";";
      size_t nitem = varArgsExpanded.size();
      if ( item < 0 )
***************
*** 261,270 ****
    this->GetListString(listString, listName.c_str());
    size_t cc;
    for ( cc = 2; cc < args.size(); ++ cc )
      {
!     if ( listString.size() )
!       {
!       listString += ";";
!       }
      listString += args[cc];
      }
--- 260,268 ----
    this->GetListString(listString, listName.c_str());
    size_t cc;
+   const char* sep = "";
    for ( cc = 2; cc < args.size(); ++ cc )
      {
!     listString += sep;
!     sep = ";";
      listString += args[cc];
      }
***************
*** 359,369 ****
  
    std::string value;
    for ( cc = 0; cc < varArgsExpanded.size(); cc ++ )
      {
!     if (value.size())
!       {
!       value += ";";
!       }
      value += varArgsExpanded[cc];
      }
  
--- 357,366 ----
  
    std::string value;
+   const char* sep = "";
    for ( cc = 0; cc < varArgsExpanded.size(); cc ++ )
      {
!     value += sep;
      value += varArgsExpanded[cc];
+     sep = ";";
      }
  
***************
*** 409,419 ****
  
    std::string value;
    for ( cc = 0; cc < varArgsExpanded.size(); cc ++ )
      {
!     if (value.size())
!       {
!       value += ";";
!       }
      value += varArgsExpanded[cc];
      }
  
--- 406,415 ----
  
    std::string value;
+   const char* sep = "";
    for ( cc = 0; cc < varArgsExpanded.size(); cc ++ )
      {
!     value += sep;
      value += varArgsExpanded[cc];
+     sep = ";";
      }
  
***************
*** 443,453 ****
    std::string value;
    std::vector<std::string>::reverse_iterator it;
    for ( it = varArgsExpanded.rbegin(); it != varArgsExpanded.rend(); ++ it )
      {
!     if (value.size())
!       {
!       value += ";";
!       }
      value += it->c_str();
      }
  
--- 439,448 ----
    std::string value;
    std::vector<std::string>::reverse_iterator it;
+   const char* sep = "";
    for ( it = varArgsExpanded.rbegin(); it != varArgsExpanded.rend(); ++ it )
      {
!     value += sep;
      value += it->c_str();
+     sep = ";";
      }
  
***************
*** 479,502 ****
    std::string value;
  
- #if 0 
-   // Fast version, but does not keep the ordering
- 
-   std::set<std::string> unique(varArgsExpanded.begin(), varArgsExpanded.end());
-   std::set<std::string>::iterator it;
-   for ( it = unique.begin(); it != unique.end(); ++ it )
-     {
-     if (value.size())
-       {
-       value += ";";
-       }
-     value += it->c_str();
-     }
- 
- #else
- 
-   // Slower version, keep the ordering
  
    std::set<std::string> unique;
    std::vector<std::string>::iterator it;
    for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
      {
--- 474,481 ----
    std::string value;
  
  
    std::set<std::string> unique;
    std::vector<std::string>::iterator it;
+   const char* sep = "";
    for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
      {
***************
*** 506,517 ****
        }
      unique.insert(*it);
! 
!     if (value.size())
!       {
!       value += ";";
!       }
      value += it->c_str();
      }
- #endif
  
  
--- 485,492 ----
        }
      unique.insert(*it);
!     value += sep;
      value += it->c_str();
+     sep = ";";
      }
  
  
***************
*** 543,559 ****
    std::string value;
    std::vector<std::string>::iterator it;
    for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
      {
!     if(value.size() == 0 && 
!        this->Makefile->GetPolicyStatus(cmPolicies::CMP0007) ==
!        cmPolicies::NEW)
!       {
!       value += ";";
!       }
!     if (value.size())
!       {
!       value += ";";
!       }
      value += it->c_str();
      }
  
--- 518,527 ----
    std::string value;
    std::vector<std::string>::iterator it;
+   const char* sep = "";
    for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it )
      {
!     value += sep;
      value += it->c_str();
+     sep = ";";
      }
  
***************
*** 605,608 ****
--- 573,577 ----
  
    std::string value;
+   const char* sep = "";
    for ( cc = 0; cc < varArgsExpanded.size(); ++ cc )
      {
***************
*** 619,627 ****
      if ( !found )
        {
!       if (value.size())
!         {
!         value += ";";
!         }
        value += varArgsExpanded[cc];
        }
      }
--- 588,594 ----
      if ( !found )
        {
!       value += sep;
        value += varArgsExpanded[cc];
+       sep = ";";
        }
      }



More information about the Cmake-commits mailing list