mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00
Fixing 18502, I misapplied the patch and checked in duplicate lines of code. Backing out.
This commit is contained in:
parent
1036442dc1
commit
f7a2cb567f
@ -808,86 +808,6 @@ imgRequest::SniffMimeType(const char *buf, PRUint32 len)
|
||||
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.
|
||||
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
|
||||
mContentType = nsCRT::strndup("image/x-icon", 12);
|
||||
|
@ -413,86 +413,6 @@ void nsUnknownDecoder::SniffForImageMimeType(const char *buf, PRUint32 len)
|
||||
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.
|
||||
if (len >= 4 && !nsCRT::memcmp(buf, "\000\000\001\000", 4)) {
|
||||
mContentType = NS_LITERAL_CSTRING("image/x-icon");
|
||||
|
Loading…
x
Reference in New Issue
Block a user