pos = path.find('*'); pos2 = path.find('?'); string::size_type pos3 = path.find(' ');
if (*(new_path.end()-1) == '/' || *(new_path.end()-1) == '\\') { std::cerr << "Trailing slash in path: \"" << new_path << "\"" << std::endl << "...compensating, but go complain to Colourless anyway" << std::endl; new_path += '.'; } #ifdef NO_WIN32_PATH_SPACES pos = new_path.find('*'); pos2 = new_path.find('?'); string::size_type pos3 = new_path.find(' ');
string get_system_path(const string &path){	string new_path;	string::size_type pos;	string::size_type pos2;	#if defined(__MORPHOS__) || defined(AMIGA)  pos = path.find( "../" );  if( pos != string::npos )	  new_path = path.substr( 0, pos )+path.substr( pos+2 );  else	  new_path = path;  pos = new_path.find( "./" );  if( pos != string::npos )	  new_path = new_path.substr( 0, pos )+new_path.substr( pos+2 );  pos = new_path.find('>');  pos2 = new_path.find('<');  // If there is no separator, return the path as is  if(pos != string::npos && pos2 == 0)  {	  pos += 1;	  // See if we can translate this prefix	  string new_prefix(path_map[new_path.substr(0, pos).c_str()]);	  // If the prefix path is not recognised, return the path as is	  if(!new_prefix.empty())		  new_path = new_prefix + new_path.substr(pos);  }#else	pos = path.find('>');	pos2 = path.find('<');	// If there is no separator, return the path as is	if(pos == string::npos || pos2 != 0) {		new_path = path;	}	else	{		pos += 1;		// See if we can translate this prefix		string new_prefix(path_map[path.substr(0, pos).c_str()]);		// If the prefix path is not recognised, return the path as is		if(new_prefix.empty()) {			new_path = path;		} else {			new_path = new_prefix + path.substr(pos);		}	}#endif	switch_slashes(new_path);#ifdef WIN32	pos = path.find('*');	pos2 = path.find('?');	string::size_type pos3 = path.find(' ');	// pos and pos2 will equal each other if neither is found	// and we'll only convert to short if a space is found	// really, we don't need to do this, but hey, you never know	if (pos == pos2 && pos3 != string::npos) {		int num_chars = GetShortPathName(new_path.c_str(), NULL, 0);		if (num_chars > 0) {			char *short_path = new char [num_chars+1];			GetShortPathName(new_path.c_str(), short_path, num_chars+1);			new_path = short_path;			delete [] short_path;		}		//else std::cerr << "Warning unable to get short path for: " << new_path << std::endl;	}#endif	return new_path;}