Changeset 203


Ignore:
Timestamp:
Jun 12, 2006, 5:33:19 PM (18 years ago)
Author:
garonne
Message:

erase repeting path in a path variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_symbol.cxx

    r144 r203  
    864864void Symbol::filter_path_value (const cmt_string& name, cmt_string& text)
    865865{
     866
    866867  CmtSystem::cmt_string_vector paths;
     868  CmtSystem::cmt_string_vector normalyzed_paths;   
    867869                 
    868870  CmtSystem::split (text, CmtSystem::path_separator (), paths);
     
    873875
    874876      if (!CmtSystem::test_directory (t))
    875         {
    876           if (Cmt::get_warnings ())
    877             {
    878               cout << "#CMT> Warning: Wrong path item " << t << " in " << name << endl;
    879             }
    880         }
    881     }
    882  
    883   Cmt::vector_to_string (paths, CmtSystem::path_separator (), text);
     877          {
     878              if (Cmt::get_warnings ())
     879              {
     880                  cout << "#CMT> Warning: Wrong path item " << t << " in " << name << endl;
     881              }
     882
     883          }
     884           
     885          bool exist = false; 
     886      for (int i = 0; i < j; ++i)
     887      {
     888          cmt_string& u = paths[i];
     889          if (u == t)
     890             exist = true;
     891      }           
     892      if (not exist)
     893      {
     894          cmt_string& s = normalyzed_paths.add ();
     895          s = t;
     896      }             
     897    }
     898   
     899  Cmt::vector_to_string (normalyzed_paths, CmtSystem::path_separator (), text);
    884900
    885901  for (;;)
Note: See TracChangeset for help on using the changeset viewer.