diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:04:03 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:04:03 +0100 |
commit | 6c8b72678daa33f7e9df2a97d6404380e1b2e8ca (patch) | |
tree | 86d46e6ad04f147f011fd332aa492259d82dc369 /src/buffer.c | |
parent | 7074704eb0b50f755f30ef21bbeb8fa064e2df5d (diff) | |
download | lighttpd-upstream/1.4.31.tar.gz |
Imported Upstream version 1.4.31upstream/1.4.31
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c index 7520b1d..43fb71c 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -566,15 +566,14 @@ int buffer_caseless_compare(const char *a, size_t a_len, const char *b, size_t b 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; - if ((a1 - b1) != 0) return (a1 - b1); + /* 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); } } |