dgaudet 99/04/20 10:27:51
Modified: src CHANGES
src/modules/standard mod_mime.c
Log:
islower() returns true for stuff outside a-z when locale isn't C
PR: 3427
Revision Changes Path
1.1310 +3 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1309
retrieving revision 1.1310
diff -u -r1.1309 -r1.1310
--- CHANGES 1999/04/20 17:03:25 1.1309
+++ CHANGES 1999/04/20 17:27:47 1.1310
@@ -1,5 +1,8 @@
Changes with Apache 1.3.7
+ *) Fix the mod_mime hash table to work properly with locales other
+ than C. [Dean Gaudet] PR#3427
+
*) Fix a memory leak which is exacerbated by certain configurations.
[Dean Gaudet] PR#4225
1.49 +2 -7 apache-1.3/src/modules/standard/mod_mime.c
Index: mod_mime.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- mod_mime.c 1999/01/01 19:05:11 1.48
+++ mod_mime.c 1999/04/20 17:27:51 1.49
@@ -233,13 +233,8 @@
* get private versions through AddType...
*/
-/* MIME_HASHSIZE used to be 27 (26 chars and one "non-alpha" slot), but
- * with character sets like EBCDIC, this is insufficient because the
- * range 'a'...'z' is not contigous. Defining it as ('z'-'a'+2) is
- * equivalent to 27 in ASCII, and makes it work in EBCDIC.
- */
-#define MIME_HASHSIZE ('z'-'a'+2)
-#define hash(i) (ap_isalpha(i) ? (ap_tolower(i)) - 'a' : (MIME_HASHSIZE-1))
+#define MIME_HASHSIZE (32)
+#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)
static table *hash_buckets[MIME_HASHSIZE];