ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10769] New: - basename suffix attribute broken
Date Sat, 13 Jul 2002 08:50:01 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10769>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10769

basename suffix attribute broken

           Summary: basename suffix attribute broken
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: jan.grant@bristol.ac.uk


In a nutshell:
<basename file="/a/b/c/foo.xml.xslt" property="x" suffix=".xslt"/>
doesn't do what you'd expect. Fix is a one-liner:

*** Basename.java.orig  Sat Jul 13 09:43:04 2002
--- Basename.java       Sat Jul 13 09:43:17 2002
***************
*** 127,133 ****
        } else {
          value = file.getName();
          if (suffix != null && value.endsWith(suffix)) {
!             int pos = value.indexOf('.');
              value = value.substring(0, pos);
          }
          getProject().setNewProperty(property, value);
--- 127,133 ----
        } else {
          value = file.getName();
          if (suffix != null && value.endsWith(suffix)) {
!             int pos = value.lastIndexOf('.');
              value = value.substring(0, pos);
          }
          getProject().setNewProperty(property, value);

Should do it.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message