diff options
author | Brad King <brad.king@kitware.com> | 2001-06-11 14:18:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-06-11 14:18:30 (GMT) |
commit | 38d5b4a4c3e3bd3bbb7160dce5cacc5ff07aaf04 (patch) | |
tree | a94889517ea28719e888f468bc743076ae70ff34 /Source/cmSystemTools.cxx | |
parent | dc8d8fbc006a97561e8c3cfe825af3689870c2ea (diff) | |
download | CMake-38d5b4a4c3e3bd3bbb7160dce5cacc5ff07aaf04.zip CMake-38d5b4a4c3e3bd3bbb7160dce5cacc5ff07aaf04.tar.gz CMake-38d5b4a4c3e3bd3bbb7160dce5cacc5ff07aaf04.tar.bz2 |
BUG: Fixed regular expression used to match registry entries. The expression now matches everything after a [HKEY until the first ']' is encountered.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index e9efdcc..3164d61 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -270,7 +270,13 @@ bool ReadAValue(std::string &res, const char *key) void cmSystemTools::ExpandRegistryValues(std::string& source) { #if defined(_WIN32) && !defined(__CYGWIN__) - cmRegularExpression regEntry("\\[(HKEY[A-Za-z0-9_~\\:\\-\\(\\)\\.\\; ]*)\\]"); + // Regular expression to match anything inside [...] that begins in HKEY. + // Note that there is a special rule for regular expressions to match a + // close square-bracket inside a list delimited by square brackets. + // The "[^]]" part of this expression will match any character except + // a close square-bracket. The ']' character must be the first in the + // list of characters inside the [^...] block of the expression. + cmRegularExpression regEntry("\\[(HKEY[^]]*)\\]"); // check for black line or comment while (regEntry.find(source)) |