NOTE:
This patch was included in Apache 1.3.24, so you shouldn't use it now...

#include <apache_license>
#undef copyright

This patch define a new index option

IndexOptions +IgnoreCase

If "IgnoreCase" is set, sort on filenames is performed case-insensitive
(if filenames are "case-equal", sort is performed in the usual way.)

--cut here--

*** src/modules/standard/mod_autoindex.c.orig	Wed Feb  2 21:44:01 2000
--- src/modules/standard/mod_autoindex.c	Tue Oct 10 01:41:14 2000
***************
*** 96,101 ****
--- 96,102 ----
  #define SUPPRESS_COLSORT 128
  #define NO_OPTIONS 256
  #define FOLDERS_FIRST 512
+ #define SORT_NOCASE 1024
  
  #define K_PAD 1
  #define K_NOPAD 0
***************
*** 406,411 ****
--- 407,415 ----
          else if (!strcasecmp(w, "FoldersFirst")) {
              option = FOLDERS_FIRST;
  	}
+         else if (!strcasecmp(w, "IgnoreCase")) {
+             option = SORT_NOCASE;
+ 	}
  	else if (!strcasecmp(w, "None")) {
  	    if (action != '\0') {
  		return "Cannot combine '+' or '-' with 'None' keyword";
***************
*** 727,732 ****
--- 731,737 ----
      int ascending;
      int isdir;
      int checkdir;
+     int ignorecase;
      char key;
  };
  
***************
*** 1217,1222 ****
--- 1222,1228 ----
       * rather than CPU.
       */
      p->checkdir = ((d->opts & FOLDERS_FIRST) != 0);
+     p->ignorecase = ((d->opts & SORT_NOCASE) != 0);
      p->key = ap_toupper(keyid);
      p->ascending = (ap_toupper(direction) == D_ASCENDING);
  
***************
*** 1587,1592 ****
--- 1593,1606 ----
          }
          break;
      }
+ 
+     if (c1->ignorecase) {
+         result = strcasecmp(c1->name, c2->name);
+         if (result) {
+             return result;
+         }
+     }
+ 
      return strcmp(c1->name, c2->name);
  }

*** htdocs/manual/mod/mod_autoindex.html.orig	Tue Oct 10 17:13:09 2000
--- htdocs/manual/mod/mod_autoindex.html	Tue Oct 10 17:25:53 2000
***************
*** 565,570 ****
--- 565,572 ----
   Apache 1.3.3 and later; the <samp>FoldersFirst</samp> and
   <samp>DescriptionWidth</samp> options are only
-  available with Apache 1.3.10 and later
+  available with Apache 1.3.10 and later;
+  the <samp>IgnoreCase</samp> option is available only on <a target="_blank"
+   href="http://freepage.logicom.it/ta/modules/mod_autoindex.ignorecase.patch">patched</a> servers.
  <P>
  
  The IndexOptions directive specifies the behavior of the directory indexing.
***************
*** 632,637 ****
--- 634,649 ----
  images have been loaded.  If no value is given for the option, it
  defaults to the standard width of the icons supplied with the Apache
  software.
+ <dt><a name="indexoptions:ignorecase">IgnoreCase
+  (<i>patched Apache 1.3.12 and later</i>)</a></dt>
+ <dd>
+ If this option is enabled, names are sorted in case-insensitive manner.
+ For instance, if the sort order is ascending by name, and
+ <samp>IgnoreCase</samp> is enabled, file <samp>Zeta</samp> will be listed
+ after file <samp>alfa</samp> (Note: file <samp>GAMMA</samp> will always be
+ listed before file <samp>gamma</samp>). <b>This option only has an effect if
+ <a href="#indexoptions:fancyindexing"><samp>FancyIndexing</samp></a>
+ is also enabled.</b></dd>
  <DT><A NAME="indexoptions:namewidth">NameWidth=[<EM>n</EM> | *] (<EM>Apache 1.3.2 and later</EM>)</A>
  <DD>
  The NameWidth keyword allows you to specify the width of the


