Index: docs/index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.201
diff -u -r1.201 index.html
--- docs/index.html	2001/02/04 01:00:41	1.201
+++ docs/index.html	2001/02/04 12:05:44
@@ -1048,6 +1048,12 @@
       taken to be an exclude pattern.</td>
     <td valign="top" align="center">No</td>
   </tr>
+  <tr>
+    <td valign="top">ignorecase</td>
+    <td valign="top">Ignore the case of paths and filenames while looking for
+	  matching files. Defaults to false (case-sensitive).</td>
+    <td valign="top" align="center">No</td>
+  </tr>
 </table>
 
 <h4>Examples</h4>
Index: src/main/org/apache/tools/ant/DirectoryScanner.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
retrieving revision 1.8
diff -u -r1.8 DirectoryScanner.java
--- src/main/org/apache/tools/ant/DirectoryScanner.java	2001/01/03 14:18:26	1.8
+++ src/main/org/apache/tools/ant/DirectoryScanner.java	2001/02/04 12:05:52
@@ -204,11 +204,22 @@
     protected boolean haveSlowResults = false;
 
     /**
+     * Should we ignore the case of the files on scan?
+     */
+    private boolean ignoreCase = false;
+
+    /**
      * Constructor.
      */
     public DirectoryScanner() {
     }
 
+    /**
+     * Specifies that case should be ignored while scanning for files.
+     */ 
+    public void setIgnoreCase(boolean value) {
+        ignoreCase = value;
+    }
 
     /**
      * Does the path match the start of this pattern up to the first "**".
@@ -221,7 +232,7 @@
      * @param pattern the (non-null) pattern to match against
      * @param str     the (non-null) string (path) to match
      */
-    protected static boolean matchPatternStart(String pattern, String str) {
+    protected static boolean matchPatternStart(String pattern, String str, boolean ignoreCase) {
         // When str starts with a File.separator, pattern has to start with a
         // File.separator.
         // When pattern starts with a File.separator, str has to start with a
@@ -254,7 +265,7 @@
             if (patDir.equals("**")) {
                 break;
             }
-            if (!match(patDir,(String)strDirs.elementAt(strIdxStart))) {
+            if (!match(patDir,(String)strDirs.elementAt(strIdxStart), ignoreCase)) {
                 return false;
             }
             patIdxStart++;
@@ -283,7 +294,7 @@
      * @return <code>true</code> when the pattern matches against the string.
      *         <code>false</code> otherwise.
      */
-    protected static boolean matchPath(String pattern, String str) {
+    protected static boolean matchPath(String pattern, String str, boolean ignoreCase) {
         // When str starts with a File.separator, pattern has to start with a
         // File.separator.
         // When pattern starts with a File.separator, str has to start with a
@@ -316,7 +327,7 @@
             if (patDir.equals("**")) {
                 break;
             }
-            if (!match(patDir,(String)strDirs.elementAt(strIdxStart))) {
+            if (!match(patDir,(String)strDirs.elementAt(strIdxStart), ignoreCase)) {
                 return false;
             }
             patIdxStart++;
@@ -343,7 +354,7 @@
             if (patDir.equals("**")) {
                 break;
             }
-            if (!match(patDir,(String)strDirs.elementAt(strIdxEnd))) {
+            if (!match(patDir,(String)strDirs.elementAt(strIdxEnd), ignoreCase)) {
                 return false;
             }
             patIdxEnd--;
@@ -382,7 +393,7 @@
                 for (int j = 0; j < patLength; j++) {
                     String subPat = (String)patDirs.elementAt(patIdxStart+j+1);
                     String subStr = (String)strDirs.elementAt(strIdxStart+i+j);
-                    if (!match(subPat,subStr)) {
+                    if (!match(subPat,subStr, ignoreCase)) {
                         continue strLoop;
                     }
                 }
@@ -423,7 +434,7 @@
      * @return <code>true</code> when the string matches against the pattern,
      *         <code>false</code> otherwise.
      */
-    protected static boolean match(String pattern, String str) {
+    protected static boolean match(String pattern, String str, boolean ignoreCase) {
         char[] patArr = pattern.toCharArray();
         char[] strArr = str.toCharArray();
         int patIdxStart = 0;
@@ -448,7 +459,10 @@
             for (int i = 0; i <= patIdxEnd; i++) {
                 ch = patArr[i];
                 if (ch != '?' && ch != strArr[i]) {
-                    return false; // Character mismatch
+                    if (!ignoreCase)
+                        return false; // Character mismatch
+                    if (Character.toLowerCase(ch) != Character.toLowerCase(strArr[i]))
+                        return false; // Character mismatch
                 }
             }
             return true; // String matches against pattern
@@ -461,7 +475,10 @@
         // Process characters before first star
         while((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {
             if (ch != '?' && ch != strArr[strIdxStart]) {
-                return false;
+                if (!ignoreCase)
+                    return false; // Character mismatch
+                if (Character.toLowerCase(ch) != Character.toLowerCase(strArr[strIdxStart]))
+                    return false; // Character mismatch
             }
             patIdxStart++;
             strIdxStart++;
@@ -480,7 +497,10 @@
         // Process characters after last star
         while((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {
             if (ch != '?' && ch != strArr[strIdxEnd]) {
-                return false;
+                if (!ignoreCase)
+                    return false; // Character mismatch
+                if (Character.toLowerCase(ch) != Character.toLowerCase(strArr[strIdxEnd]))
+                    return false; // Character mismatch
             }
             patIdxEnd--;
             strIdxEnd--;
@@ -521,7 +541,11 @@
                 for (int j = 0; j < patLength; j++) {
                     ch = patArr[patIdxStart+j+1];
                     if (ch != '?' && ch != strArr[strIdxStart+i+j]) {
-                        continue strLoop;
+                        if (!ignoreCase)
+                            continue strLoop; // Character mismatch
+                        if (Character.toLowerCase(ch) 
+                            != Character.toLowerCase(strArr[strIdxStart+i+j]))
+                            continue strLoop; // Character mismatch
                     }
                 }
 
@@ -787,7 +811,7 @@
      */
     protected boolean isIncluded(String name) {
         for (int i = 0; i < includes.length; i++) {
-            if (matchPath(includes[i],name)) {
+            if (matchPath(includes[i],name,ignoreCase)) {
                 return true;
             }
         }
@@ -803,7 +827,7 @@
      */
     protected boolean couldHoldIncluded(String name) {
         for (int i = 0; i < includes.length; i++) {
-            if (matchPatternStart(includes[i],name)) {
+            if (matchPatternStart(includes[i],name,ignoreCase)) {
                 return true;
             }
         }
@@ -819,7 +843,7 @@
      */
     protected boolean isExcluded(String name) {
         for (int i = 0; i < excludes.length; i++) {
-            if (matchPath(excludes[i],name)) {
+            if (matchPath(excludes[i],name,ignoreCase)) {
                 return true;
             }
         }
Index: src/main/org/apache/tools/ant/types/FileSet.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FileSet.java,v
retrieving revision 1.13
diff -u -r1.13 FileSet.java
--- src/main/org/apache/tools/ant/types/FileSet.java	2001/02/01 17:14:05	1.13
+++ src/main/org/apache/tools/ant/types/FileSet.java	2001/02/04 12:05:54
@@ -80,12 +80,21 @@
 
     private File dir;
     private boolean useDefaultExcludes = true;
+    private boolean ignoreCase = false;
 
     public FileSet() {
         super();
     }
 
     /**
+     * Makes this instance (and the DirectoryScanner) ignore
+     * the case of the files included or excluded.
+     */
+    public void setIgnoreCase(boolean value) {
+        ignoreCase = value;
+    }
+
+    /**
      * Makes this instance in effect a reference to another PatternSet
      * instance.
      *
@@ -234,6 +243,7 @@
         }
 
         DirectoryScanner ds = new DirectoryScanner();
+        ds.setIgnoreCase(ignoreCase);
         setupDirectoryScanner(ds, p);
         ds.scan();
         return ds;
