Changes with Apache 1.3.24
+ *) Add 'IgnoreCase' keyword to the DirectoryIndex directive;
+ if active, upper- and lower-case letters are insignificant
+ in ordering. In other words, all A* and a* files will be
+ listed together, rather than the a* ones after all the [A-Z]*
+ ones. [Tullio Andreatta <tullio@logicom.it>]
+
*) NetWare: Implemented the real ap_os_case_canonical_filename()
- function that retrieves the accurately cased path and file
- name from the file system. [Brad Nicholes bnicholes@novell.com]
+ function that retrieves the accurately cased path and file
+ name from the file system. [Brad Nicholes bnicholes@novell.com]
*) Fix the longstanding bug that errors (returned by src/Configure)
would not be noticed by the top level configure script.
#define NO_OPTIONS 256
#define FOLDERS_FIRST 512
#define TRACK_MODIFIED 1024
+#define SORT_NOCASE 2048
#define K_PAD 1
#define K_NOPAD 0
else if (!strcasecmp(w, "TrackModified")) {
option = TRACK_MODIFIED;
}
+ else if (!strcasecmp(w, "IgnoreCase")) {
+ option = SORT_NOCASE;
+ }
else if (!strcasecmp(w, "None")) {
if (action != '\0') {
return "Cannot combine '+' or '-' with 'None' keyword";
int ascending;
int isdir;
int checkdir;
+ int ignorecase;
char key;
};
* 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);
struct ent *c1;
struct ent *c2;
int result = 0;
+ int ignorecase;
/*
* First, see if either of the entries is for the parent directory.
}
break;
}
- return strcmp(c1->name, c2->name);
+
+ ignorecase = c1->ignorecase;
+ if (ignorecase) {
+ result = strcasecmp(c1->name, c2->name);
+ if (result == 0) {
+ /*
+ * They're identical when treated case-insensitively, so
+ * pretend they weren't and let strcmp() put them in a
+ * deterministic order. This means that 'ABC' and 'abc'
+ * will always appear in the same order, rather than
+ * unpredictably 'ABC abc' or 'abc ABC'.
+ */
+ ignorecase = 0;
+ }
+ }
+ if (! ignorecase) {
+ result = strcmp(c1->name, c2->name);
+ }
+ return result;
}