mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Allow symmetrical patterns for replace keys
Update getReplaceKeys to allow for patterns with matching start and end delimiters. Previously, `%%key%%` would throw and OutOfBoundsException instead of matching the key inside the delimiters.
This commit is contained in:
parent
ad15e0e804
commit
eb237ebcba
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ public class ProcessHelper {
|
||||||
int start = 0;
|
int start = 0;
|
||||||
int end = 0;
|
int end = 0;
|
||||||
while ((start = str.indexOf(startPattern, start)) >= 0) {
|
while ((start = str.indexOf(startPattern, start)) >= 0) {
|
||||||
end = str.indexOf(endPattern, start);
|
end = str.indexOf(endPattern, start + startPattern.length());
|
||||||
if (end != -1) {
|
if (end != -1) {
|
||||||
replaceStrings.add(str.substring(start + startPattern.length(), end));
|
replaceStrings.add(str.substring(start + startPattern.length(), end));
|
||||||
start = end + endPattern.length();
|
start = end + endPattern.length();
|
||||||
|
|
Loading…
Add table
Reference in a new issue