diff --git a/SystemTools.cxx b/SystemTools.cxx
index fe96160a40a551b7fa8f914330caa1753eb756ae..e77c22d07149c84e42f941337400c07b373cb3fc 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -708,7 +708,14 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
   kwsys_stl::string::size_type pos = 0;
   while((pos = path.find('\\', pos)) != kwsys_stl::string::npos)
     {
-    path[pos] = '/';
+    // make sure we don't convert an escaped space to a unix slash
+    if(pos < path.size()-2)
+      {
+      if(path[pos+1] != ' ')
+        {
+        path[pos] = '/';
+        }
+      }
     pos++;
     }
   // Remove all // from the path just like most unix shells