[cmake-commits] king committed cmSystemTools.cxx 1.335 1.336
cmSystemTools.h 1.136 1.137
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Mar 8 09:48:20 EST 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv22164
Modified Files:
cmSystemTools.cxx cmSystemTools.h
Log Message:
STYLE: Removing unused methods ConvertToShellPath and EscapeForUnixShell.
Index: cmSystemTools.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.h,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- cmSystemTools.h 22 Feb 2007 02:24:17 -0000 1.136
+++ cmSystemTools.h 8 Mar 2007 14:48:17 -0000 1.137
@@ -293,12 +293,8 @@
// be used when RunCommand is called from cmake, because the
// running cmake needs paths to be in its format
static std::string ConvertToRunCommandPath(const char* path);
- // convert to a shell path
- static std::string ConvertToShellPath(const char* path);
//! Check if the first string ends with the second one.
static bool StringEndsWith(const char* str1, const char* str2);
- // escape for unix shells
- static std::string EscapeForUnixShell(std::string& result);
static bool CreateSymlink(const char* origName, const char* newName);
/** compute the relative path from local to remote. local must
Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.335
retrieving revision 1.336
diff -u -d -r1.335 -r1.336
--- cmSystemTools.cxx 22 Feb 2007 02:24:17 -0000 1.335
+++ cmSystemTools.cxx 8 Mar 2007 14:48:17 -0000 1.336
@@ -1341,64 +1341,6 @@
#endif
}
-std::string cmSystemTools::EscapeForUnixShell(std::string& result)
-{
- // For UNIX Shell paths we need to escape () in the path
- if(result.find_first_of("()") != result.npos)
- {
- std::string newResult = "";
- char lastch = 1;
- bool inDollarVariable = false;
- for(const char* ch = result.c_str(); *ch != '\0'; ++ch)
- {
- // if it is already escaped then don't try to escape it again
- if((*ch == ' ' || *ch == '(' || *ch == ')') && lastch != '\\')
- {
- if(*ch == '(' && lastch == '$')
- {
- inDollarVariable = true;
- }
- // if we are in a $(..... and we get a ) then do not escape
- // the ) and but set inDollarVariable to false
- else if(*ch == ')' && inDollarVariable)
- {
- inDollarVariable = false;
- }
- else
- {
- newResult += '\\';
- }
- }
- newResult += *ch;
- lastch = *ch;
- }
- return newResult;
- }
- return result;
-}
-
-std::string cmSystemTools::ConvertToShellPath(const char* path)
-{
- bool useUnix = false; // assume windows
-#if defined(_WIN32) && !defined(__CYGWIN__)
- // if windows and force paths but not cygwin useUnix is on
- if(s_ForceUnixPaths)
- {
- useUnix = true;
- }
-#else
- // if not win32 and maybe cygwin then unix is true
- useUnix = true;
-#endif
- // if unix we need to call EscapeForUnixShell as well
- if(useUnix)
- {
- std::string result = cmSystemTools::ConvertToUnixOutputPath(path);
- return cmSystemTools::EscapeForUnixShell(result);
- }
- return cmSystemTools::ConvertToWindowsOutputPath(path);
-}
-
std::string cmSystemTools::ConvertToRunCommandPath(const char* path)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
More information about the Cmake-commits
mailing list