зеркало из https://github.com/mozilla/pjs.git
Fixing 18502, I misapplied the patch and checked in duplicate lines of code. Backing out.
This commit is contained in:
Родитель
29fc3e2710
Коммит
3e07b91e11
|
@ -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");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче