cmLocalGenerator: Remove EscapeForShellOldStyle to only caller.
This commit is contained in:
parent
443f041c2f
commit
a3139d4b15
@ -50,6 +50,35 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
|||||||
return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
|
return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string escapeForShellOldStyle(const std::string& str)
|
||||||
|
{
|
||||||
|
std::string result;
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
// if there are spaces
|
||||||
|
std::string temp = str;
|
||||||
|
if (temp.find(" ") != std::string::npos &&
|
||||||
|
temp.find("\"")==std::string::npos)
|
||||||
|
{
|
||||||
|
result = "\"";
|
||||||
|
result += str;
|
||||||
|
result += "\"";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
#else
|
||||||
|
for(const char* ch = str.c_str(); *ch != '\0'; ++ch)
|
||||||
|
{
|
||||||
|
if(*ch == ' ')
|
||||||
|
{
|
||||||
|
result += '\\';
|
||||||
|
}
|
||||||
|
result += *ch;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmCustomCommandGenerator
|
cmCustomCommandGenerator
|
||||||
@ -63,7 +92,7 @@ cmCustomCommandGenerator
|
|||||||
cmd += " ";
|
cmd += " ";
|
||||||
if(this->OldStyle)
|
if(this->OldStyle)
|
||||||
{
|
{
|
||||||
cmd += this->LG->EscapeForShellOldStyle(arg);
|
cmd += escapeForShellOldStyle(arg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3391,35 +3391,6 @@ cmLocalGenerator
|
|||||||
return source.GetLanguage();
|
return source.GetLanguage();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
std::string cmLocalGenerator::EscapeForShellOldStyle(const std::string& str)
|
|
||||||
{
|
|
||||||
std::string result;
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
||||||
// if there are spaces
|
|
||||||
std::string temp = str;
|
|
||||||
if (temp.find(" ") != std::string::npos &&
|
|
||||||
temp.find("\"")==std::string::npos)
|
|
||||||
{
|
|
||||||
result = "\"";
|
|
||||||
result += str;
|
|
||||||
result += "\"";
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
#else
|
|
||||||
for(const char* ch = str.c_str(); *ch != '\0'; ++ch)
|
|
||||||
{
|
|
||||||
if(*ch == ' ')
|
|
||||||
{
|
|
||||||
result += '\\';
|
|
||||||
}
|
|
||||||
result += *ch;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static bool cmLocalGeneratorIsShellOperator(const std::string& str)
|
static bool cmLocalGeneratorIsShellOperator(const std::string& str)
|
||||||
{
|
{
|
||||||
|
@ -298,9 +298,6 @@ public:
|
|||||||
bool forEcho = false,
|
bool forEcho = false,
|
||||||
bool useWatcomQuote = false);
|
bool useWatcomQuote = false);
|
||||||
|
|
||||||
/** Backwards-compatibility version of EscapeForShell. */
|
|
||||||
std::string EscapeForShellOldStyle(const std::string& str);
|
|
||||||
|
|
||||||
/** Escape the given string as an argument in a CMake script. */
|
/** Escape the given string as an argument in a CMake script. */
|
||||||
static std::string EscapeForCMake(const std::string& str);
|
static std::string EscapeForCMake(const std::string& str);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user