summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-20 20:12:21 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-20 20:12:36 (GMT)
commitcde127b08441b23f7210bfe987812f8d253e960b (patch)
tree46f4a63fbacf8e5b1ccdf83be9c26cb411fb5fae
parentc23f89bc7651609865164c95ce3655ebd369c11e (diff)
downloadCMake-cde127b08441b23f7210bfe987812f8d253e960b.zip
CMake-cde127b08441b23f7210bfe987812f8d253e960b.tar.gz
CMake-cde127b08441b23f7210bfe987812f8d253e960b.tar.bz2
cmOutputConverter::Convert: invert condition
Make the control flow of the 'optional' argument more explicit.
-rw-r--r--Source/cmOutputConverter.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index a23478b..a45e37b 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -168,14 +168,14 @@ std::string cmOutputConverter::Convert(RelativeRoot remote,
const char* remotePath = this->GetRelativeRootPath(remote);
assert(remotePath != 0);
- if (!local.empty() && !optional) {
- std::vector<std::string> components;
- cmSystemTools::SplitPath(local, components);
- std::string result = this->ConvertToRelativePath(components, remotePath);
- return this->ConvertToOutputFormat(result, output);
+ if (local.empty() || optional) {
+ return this->ConvertToOutputFormat(remotePath, output);
}
- return this->ConvertToOutputFormat(remotePath, output);
+ std::vector<std::string> components;
+ cmSystemTools::SplitPath(local, components);
+ std::string result = this->ConvertToRelativePath(components, remotePath);
+ return this->ConvertToOutputFormat(result, output);
}
static bool cmOutputConverterNotAbove(const char* a, const char* b)