ignore case when looking for Main-Class manifest attribute

Per the spec, attribute names should be case-insensitive:

http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html
This commit is contained in:
Joel Dice 2012-08-05 19:18:51 -06:00
parent 021590af05
commit 5a7c78e71a

View File

@ -114,8 +114,8 @@ mainClass(const char* jar)
unsigned length;
while (readLine(region->start(), region->length(), &start, &length)) {
const unsigned PrefixLength = 12;
if (strncmp("Main-Class: ", reinterpret_cast<const char*>
(region->start() + start), PrefixLength) == 0)
if (strncasecmp("Main-Class: ", reinterpret_cast<const char*>
(region->start() + start), PrefixLength) == 0)
{
result = static_cast<char*>(malloc(length + 1 - PrefixLength));
memcpy(result, region->start() + start + PrefixLength,