void Path::add_component(const string &comp)
{
- if(comp.size()==1 && comp[0]==DIRSEP)
+ if(comp.size()==1 && (comp[0]=='/' || comp[0]=='\\'))
{
// Replace the path with the root directory
#ifdef WIN32
else
#endif
{
- path = comp;
+ path.assign(1, DIRSEP);
separators.clear();
separators.push_back(0);
}