From 54d745c6c2eedbfbecc0e14610f786f16c2bc996 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 16 Apr 2002 05:47:41 +0000 Subject: [PATCH] add rule that"$"->"$"; retaining "$$"->"$" Fundamental changes like this scare me. I wonder what the gump is going to show up here. If all is well; nothing. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272447 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/ProjectHelper.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/ProjectHelper.java b/src/main/org/apache/tools/ant/ProjectHelper.java index 493355968..67314529b 100644 --- a/src/main/org/apache/tools/ant/ProjectHelper.java +++ b/src/main/org/apache/tools/ant/ProjectHelper.java @@ -472,7 +472,7 @@ public class ProjectHelper { while ((pos = value.indexOf("$", prev)) >= 0) { //if there was any text before this, add it as a fragment - //TODO, this check could me modified to go if pos>prev; + //TODO, this check could be modified to go if pos>prev; //seems like this current version could stick empty strings //into the list if (pos > 0) { @@ -486,8 +486,20 @@ public class ProjectHelper { } else if (value.charAt(pos + 1) != '{') { //peek ahead to see if the next char is a property or not //not a property: insert the char as a literal + /* fragments.addElement(value.substring(pos + 1, pos + 2)); prev = pos + 2; + */ + if(value.charAt(pos + 1) == '$') { + //backwards compatibility two $ map to one mode + fragments.addElement("$"); + prev = pos + 2; + } else { + //new behaviour: $X maps to $X for all values of X!='$' + fragments.addElement(value.substring(pos, pos + 2)); + prev = pos + 2; + } + } else { //property found, extract its name or bail on a typo int endName = value.indexOf('}', pos);