From 5f518191bd6c58ea8b4c0673600ba1056b6a9026 Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Fri, 17 Aug 2007 21:47:24 +0000 Subject: [PATCH] fixed wrong result of buffer_caseless_compare("a", "ab") (fixes #1287) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1927 152afb58-edef-0310-8abb-c4023f1b3aa9 --- src/buffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index 094cee20..c7f547c2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -574,7 +574,13 @@ int buffer_caseless_compare(const char *a, size_t a_len, const char *b, size_t b } } - return 0; + /* all chars are the same, and the length match too + * + * they are the same */ + if (a_len == b_len) return 0; + + /* if a is shorter then b, then b is larger */ + return (a_len - b_len); }