Fixing 18502, I misapplied the patch and checked in duplicate lines of code. Backing out.

This commit is contained in:
hyatt%netscape.com 2001-11-03 12:00:32 +00:00
Родитель 1036442dc1
Коммит f7a2cb567f
2 изменённых файлов: 0 добавлений и 160 удалений

Просмотреть файл

@ -808,86 +808,6 @@ imgRequest::SniffMimeType(const char *buf, PRUint32 len)
return; return;
} }
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
// ALWAYS KEEP THIS SNIFF AT THE END OF THE FILE!
if (len >= 4 &&
((PRUint16*)buf)[0]==0 &&
(LITTLE_TO_NATIVE16(((PRUint16*)buf)[1]))==1) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12);
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = nsCRT::strndup("image/bmp", 9);
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1. // ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) { if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = nsCRT::strndup("image/x-icon", 12); mContentType = nsCRT::strndup("image/x-icon", 12);

Просмотреть файл

@ -413,86 +413,6 @@ void nsUnknownDecoder::SniffForImageMimeType(const char *buf, PRUint32 len)
return; return;
} }
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
// ALWAYS KEEP THIS SNIFF AT THE END OF THE FILE!
if (len >= 4 &&
((PRUint16*)buf)[0]==0 &&
(LITTLE_TO_NATIVE16(((PRUint16*)buf)[1]))==1) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon");
return;
}
if (len >= 2 && !nsCRT::strncmp(buf, "BM", 2)) {
mContentType = NS_LITERAL_CSTRING("image/bmp");
return;
}
// ICOs always begin with a 2-byte 0 followed by a 2-byte 1. // ICOs always begin with a 2-byte 0 followed by a 2-byte 1.
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) { if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
mContentType = NS_LITERAL_CSTRING("image/x-icon"); mContentType = NS_LITERAL_CSTRING("image/x-icon");