Browse Source

BUG: half fix for 6688, expand registry stuff on unix just like it was not found on windows

Bill Hoffman 18 years ago
parent
commit
5a079b151a
1 changed files with 12 additions and 1 deletions
  1. 12 1
      Source/cmSystemTools.cxx

+ 12 - 1
Source/cmSystemTools.cxx

@@ -149,8 +149,19 @@ void cmSystemTools::ExpandRegistryValues(std::string& source)
     }
 }
 #else
-void cmSystemTools::ExpandRegistryValues(std::string&)
+void cmSystemTools::ExpandRegistryValues(std::string& source)
 {
+  cmsys::RegularExpression regEntry("\\[(HKEY[^]]*)\\]");
+  while (regEntry.find(source))
+    {
+    // the arguments are the second match
+    std::string key = regEntry.match(1);
+    std::string val;
+    std::string reg = "[";
+    reg += key + "]";
+    cmSystemTools::ReplaceString(source, reg.c_str(), "/registry");
+    }
+
 }
 #endif