cmLocalUnixMakefileGenerator3: Re-organize ConvertToQuotedOutputPath

Use one code path whether the components list is empty or not.
Fix indentation accordingly.
This commit is contained in:
Jiri Malak 2014-03-25 07:17:45 +01:00 committed by Brad King
parent a29ea834de
commit a863a8fecd
1 changed files with 33 additions and 34 deletions

View File

@ -2183,17 +2183,16 @@ cmLocalUnixMakefileGenerator3
std::string
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
{
// Split the path into its components.
std::vector<std::string> components;
cmSystemTools::SplitPath(p, components);
// Return an empty path if there are no components.
if(components.empty())
{
return "\"\"";
}
// Open the quoted result.
std::string result = "\"";
// Return an empty path if there are no components.
if(!components.empty())
{
// Choose a slash direction and fix root component.
const char* slash = "/";
#if defined(_WIN32) && !defined(__CYGWIN__)
@ -2212,7 +2211,6 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
#endif
// Begin the quoted result with the root component.
std::string result = "\"";
result += components[0];
// Now add the rest of the components separated by the proper slash
@ -2231,6 +2229,7 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
first = false;
}
}
}
// Close the quoted result.
result += "\"";