You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2015/05/16 01:06:40 UTC

git commit: [flex-utilities] [refs/heads/develop] - 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

Repository: flex-utilities
Updated Branches:
  refs/heads/develop 2badd7431 -> 6961f8a20


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/develop
Commit: 6961f8a209ff1903fc87eb98163ced965356a05c
Parents: 2badd74
Author: Josh Tynjala <jo...@apache.org>
Authored: Fri May 15 16:06:31 2015 -0700
Committer: Josh Tynjala <jo...@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 &lt;cdata/&gt;">
+        <fail message="replace did not work: did not find &lt;replaced/&gt;&lt;test/&gt;">
             <condition>
                 <not>
-                    <equals arg1="${xml}" arg2="&lt;cdata/&gt;" />
+                    <equals arg1="${xml}" arg2="&lt;replaced/&gt;&lt;test/&gt;" />
                 </not>
             </condition>
         </fail>