AntOnAIR: fixed issue in Replace task where if the token was replaced with a value that contained the token, the task could get stuck in an infinite loop
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/6961f8a2 Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/6961f8a2 Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/6961f8a2 Branch: refs/heads/as3httpclient-work Commit: 6961f8a209ff1903fc87eb98163ced965356a05c Parents: 2badd74 Author: Josh Tynjala <joshtynj...@apache.org> Authored: Fri May 15 16:06:31 2015 -0700 Committer: Josh Tynjala <joshtynj...@apache.org> Committed: Fri May 15 16:06:31 2015 -0700 ---------------------------------------------------------------------- ant_on_air/src/org/apache/flex/ant/tags/Replace.as | 2 +- ant_on_air/tests/test.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6961f8a2/ant_on_air/src/org/apache/flex/ant/tags/Replace.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Replace.as b/ant_on_air/src/org/apache/flex/ant/tags/Replace.as index 0b7ff69..2873ee1 100644 --- a/ant_on_air/src/org/apache/flex/ant/tags/Replace.as +++ b/ant_on_air/src/org/apache/flex/ant/tags/Replace.as @@ -129,7 +129,7 @@ package org.apache.flex.ant.tags var firstHalf:String = s.substr(0, c); var secondHalf:String = s.substr(c); s = firstHalf + secondHalf.replace(tokens[i], reps[i]); - cur = c + 1; + cur = c + reps[i].length; } } while (c != -1) } http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6961f8a2/ant_on_air/tests/test.xml ---------------------------------------------------------------------- diff --git a/ant_on_air/tests/test.xml b/ant_on_air/tests/test.xml index 9b6cd8f..e218795 100644 --- a/ant_on_air/tests/test.xml +++ b/ant_on_air/tests/test.xml @@ -206,7 +206,7 @@ </replace> <replace file="${basedir}/temp/custom.properties"> <replacetoken><![CDATA[<test/>]]></replacetoken> - <replacevalue><![CDATA[<cdata/>]]></replacevalue> + <replacevalue><![CDATA[<replaced/><test/>]]></replacevalue> </replace> <loadproperties srcFile="${basedir}/temp/custom.properties" /> <fail message="replace did not work: found somekey"> @@ -240,10 +240,10 @@ </not> </condition> </fail> - <fail message="replace did not work: did not find <cdata/>"> + <fail message="replace did not work: did not find <replaced/><test/>"> <condition> <not> - <equals arg1="${xml}" arg2="<cdata/>" /> + <equals arg1="${xml}" arg2="<replaced/><test/>" /> </not> </condition> </fail>