ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Property.java
Date Sat, 24 Jun 2000 15:17:01 GMT
conor       00/06/24 08:17:00

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
               src/main/org/apache/tools/ant/taskdefs Property.java
  Log:
  Fix handling of $$ in properties
  
  Revision  Changes    Path
  1.14      +7 -2      jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ProjectHelper.java	2000/06/24 10:55:40	1.13
  +++ ProjectHelper.java	2000/06/24 15:16:59	1.14
  @@ -484,9 +484,14 @@
           // assert value!=nil
           int pos;
           while( (pos=value.indexOf( "$", prev )) >= 0 ) {
  -            if(pos>0)
  +            if(pos>0) {
                   sb.append( value.substring( prev, pos ) );
  -            if( value.charAt( pos + 1 ) != '{' ) {
  +            }
  +            if( pos == (value.length() - 1)) {
  +                sb.append('$');
  +                prev = pos + 1;
  +            }
  +            else if (value.charAt( pos + 1 ) != '{' ) {
                   sb.append( value.charAt( pos + 1 ) );
                   prev=pos+2; // XXX
               } else {
  
  
  
  1.6       +2 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Property.java	2000/05/27 22:21:10	1.5
  +++ Property.java	2000/06/24 15:17:00	1.6
  @@ -101,17 +101,16 @@
       public void init() throws BuildException {
           try {
               if ((name != null) && (value != null)) {
  -                String v = ProjectHelper.replaceProperties(value, project.getProperties());
   		if( userProperty )
                       if (project.getUserProperty(name) == null) {
  -		        project.setUserProperty(name, v);
  +		        project.setUserProperty(name, value);
                       } else {
                           project.log("Override ignored for " + name, 
                                       project.MSG_VERBOSE);
                       }
   		else
                       if (project.getProperty(name) == null) {
  -		        project.setProperty(name, v);
  +		        project.setProperty(name, value);
                       } else {
                           project.log("Override ignored for " + name, 
                                       project.MSG_VERBOSE);
  
  
  

Mime
View raw message