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
svn/tags/lighttpd-1.4.17
Jan Kneschke 2007-08-17 21:47:24 +00:00
parent 1920bd2739
commit 5f518191bd
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}