summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-07-18 15:08:10 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2017-07-21 13:09:56 (GMT)
commitb7941641430feeefadc6f16e2cecf6b50bd9fbe3 (patch)
tree0cd3337f4b799631752d94f3110c6943cd792ecd /Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
parentec049641c46eb788b25713e5d96ff32c89f0e819 (diff)
downloadCMake-b7941641430feeefadc6f16e2cecf6b50bd9fbe3.zip
CMake-b7941641430feeefadc6f16e2cecf6b50bd9fbe3.tar.gz
CMake-b7941641430feeefadc6f16e2cecf6b50bd9fbe3.tar.bz2
cmStringCommand: clear intermediate matches
When `string(REGEX REPLACE)` or `string(REGEX MATCHALL)` loop internally, they store their matches, but they do not clear the previous match from an earlier iteration. This can leave the contents of `CMAKE_MATCH_<N>` with bogus values for later matches in the string if they have groups which earlier matched a non-empty string, but now match an empty string. Fixes #17079.
Diffstat (limited to 'Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt')
-rw-r--r--Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
new file mode 100644
index 0000000..4360d79
--- /dev/null
+++ b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
@@ -0,0 +1,12 @@
+^matches: Some::;Scope
+results from: string\(REGEX MATCHALL\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--
+replace: \[Some\]\[Scope\]
+results from: string\(REGEX REPLACE\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--$