Convert loop to the common pattern.
This commit is contained in:
parent
abfca97525
commit
8a399c8c9f
|
@ -2299,24 +2299,18 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
|
||||||
{
|
{
|
||||||
// Now add the rest of the components separated by the proper slash
|
// Now add the rest of the components separated by the proper slash
|
||||||
// direction for this platform.
|
// direction for this platform.
|
||||||
bool first = true;
|
const char* sep = "";
|
||||||
for(unsigned int i=1; i < components.size() - 1; ++i)
|
for(unsigned int i=1; i < components.size() - 1; ++i)
|
||||||
{
|
{
|
||||||
if(!components[i].empty())
|
if(!components[i].empty())
|
||||||
{
|
{
|
||||||
if(!first)
|
result += sep;
|
||||||
{
|
|
||||||
result += slash;
|
|
||||||
}
|
|
||||||
result += components[i];
|
result += components[i];
|
||||||
first = false;
|
sep = slash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Only the last component can be empty to avoid double slashes.
|
// Only the last component can be empty to avoid double slashes.
|
||||||
if(!first)
|
result += slash;
|
||||||
{
|
|
||||||
result += slash;
|
|
||||||
}
|
|
||||||
result += components.back();
|
result += components.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue