summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2020-03-20 16:04:40 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2020-03-23 19:19:26 (GMT)
commitbfb69f9543bfa7f9f3c9488bf7e740f21896cec4 (patch)
tree866c20d05a20fae42cf06ef848796ba621d643f2 /Source/cmcmd.cxx
parent7df84ffe58572a4535b08bc7b76148a60d38fbb4 (diff)
downloadCMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.zip
CMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.tar.gz
CMake-bfb69f9543bfa7f9f3c9488bf7e740f21896cec4.tar.bz2
replace "substr(0, xx) ==" with cmHasPrefix()
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 7eeb97f..8f619b1 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1054,8 +1054,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
homeOutDir = args[5];
startOutDir = args[6];
depInfo = args[7];
- if (args.size() >= 9 && args[8].length() >= 8 &&
- args[8].substr(0, 8) == "--color=") {
+ if (args.size() >= 9 && cmHasLiteralPrefix(args[8], "--color=")) {
// Enable or disable color based on the switch value.
color = (args[8].size() == 8 || cmIsOn(args[8].substr(8)));
}
@@ -1304,7 +1303,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
} else if (arg == "--debug") {
pipe.clear();
isDebug = true;
- } else if (arg.substr(0, pipePrefix.size()) == pipePrefix) {
+ } else if (cmHasPrefix(arg, pipePrefix)) {
isDebug = false;
pipe = arg.substr(pipePrefix.size());
if (pipe.empty()) {