Browse Source

Only ensured tablength was even, not it was a power of 2.

Good to know others read my patches.

Submitted by:	Sam Ruby <rubys@us.ibm.com>,
                Fergus Gallagher <Fergus.Gallagher@OrbisUK.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267755 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
c6f8d18fe3
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -179,7 +179,7 @@ public class FixCRLF extends MatchingTask {
* @param tlength specify the length of tab in spaces, has to be a power of 2
*/
public void setTablength(int tlength) throws BuildException {
if (tlength < 2 || (tlength % 2) != 0) {
if (tlength < 2 || (tlength & (tlength-1)) == 0) {
throw new BuildException("tablength must be a positive power of 2",
location);
}


Loading…
Cancel
Save