diff options
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 03d8376..b92c074 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -30,13 +30,11 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot) std::string cmOutputConverter::ConvertToOutputForExisting( const std::string& remote, OutputFormat format) const { - // Perform standard conversion. - std::string result = this->ConvertToOutputFormat(remote, format); - // If this is a windows shell, the result has a space, and the path // already exists, we can use a short-path to reference it without a // space. - if (this->GetState()->UseWindowsShell() && result.find(' ') != result.npos && + if (this->GetState()->UseWindowsShell() && + remote.find(' ') != std::string::npos && cmSystemTools::FileExists(remote.c_str())) { std::string tmp; if (cmSystemTools::GetShortPath(remote, tmp)) { @@ -44,8 +42,8 @@ std::string cmOutputConverter::ConvertToOutputForExisting( } } - // Otherwise, leave it unchanged. - return result; + // Otherwise, perform standard conversion. + return this->ConvertToOutputFormat(remote, format); } std::string cmOutputConverter::ConvertToOutputForExisting( |