Upsteam: always convert letters to lowercase to get transitive results.

from Brad (maintainer)
This commit is contained in:
ajacoutot 2012-04-09 07:02:11 +00:00
parent d65cfde82d
commit 01a6c0fdc8
2 changed files with 29 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.95 2012/03/06 08:23:43 sthen Exp $
# $OpenBSD: Makefile,v 1.96 2012/04/09 07:02:11 ajacoutot Exp $
SHARED_ONLY= Yes
COMMENT= secure, fast, compliant, and very flexible web-server
DISTNAME= lighttpd-1.4.30
REVISION= 1
REVISION= 2
CATEGORIES= www net
MASTER_SITES= http://download.lighttpd.net/lighttpd/releases-1.4.x/

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_buffer_c,v 1.1 2012/04/09 07:02:12 ajacoutot Exp $
Always convert letters to lowercase to get transitive results.
--- src/buffer.c.orig Sun Apr 8 16:08:58 2012
+++ src/buffer.c Sun Apr 8 16:11:25 2012
@@ -566,15 +566,14 @@ int buffer_caseless_compare(const char *a, size_t a_le
max_ndx = ((a_len < b_len) ? a_len : b_len);
for (; ndx < max_ndx; ndx++) {
- char a1 = *a++, b1 = *b++;
+ int a1 = *a++, b1 = *b++;
if (a1 != b1) {
- if ((a1 >= 'A' && a1 <= 'Z') && (b1 >= 'a' && b1 <= 'z'))
- a1 |= 32;
- else if ((a1 >= 'a' && a1 <= 'z') && (b1 >= 'A' && b1 <= 'Z'))
- b1 |= 32;
+ /* always lowercase for transitive results */
+ if (a1 >= 'A' && a1 <= 'Z') a1 |= 32;
+ if (b1 >= 'A' && b1 <= 'Z') b1 |= 32;
+
if ((a1 - b1) != 0) return (a1 - b1);
-
}
}