MCPcopy Create free account
hub / github.com/Kitware/CMake / escapeForShellOldStyle

Function escapeForShellOldStyle

Source/cmCustomCommandGenerator.cxx:363–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363static std::string escapeForShellOldStyle(std::string const& str)
364{
365 std::string result;
366#if defined(_WIN32) && !defined(__CYGWIN__)
367 // if there are spaces
368 std::string temp = str;
369 if (temp.find(" ") != std::string::npos &&
370 temp.find("\"") == std::string::npos) {
371 result = cmStrCat('"', str, '"');
372 return result;
373 }
374 return str;
375#else
376 for (char const* ch = str.c_str(); *ch != '\0'; ++ch) {
377 if (*ch == ' ') {
378 result += '\\';
379 }
380 result += *ch;
381 }
382 return result;
383#endif
384}
385
386void cmCustomCommandGenerator::AppendArguments(unsigned int c,
387 std::string& cmd) const

Callers 1

AppendArgumentsMethod · 0.85

Calls 3

c_strMethod · 0.80
cmStrCatFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…