tdeio/kmimemagic: remove MAGIC_CONTINUE flag

This resolves bug 2713

The MAGIC_CONTINUE flag resulted in a malformed mimemagic responses
like "application/x-executable\012- application/octet-stream"
instead of just "application/x-executable".

This string being unparsed then caused the KMimeType::findByURL() to
fallback to application/octet-stream for nearly every mimetype.

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit f54496a1f2)
v3.5.13-sru
Alexander Golubev 8 years ago committed by Slávek Banko
parent a8e88fd005
commit cc48df2a09

@ -189,7 +189,7 @@ void process(struct config_rec* conf, const TQString & fn) {
KDE_struct_stat sb;
TQCString fileName = TQFile::encodeName( fn );
int magic_flags = MAGIC_CONTINUE|MAGIC_ERROR|MAGIC_MIME_TYPE/*|MAGIC_DEBUG*/;
int magic_flags = MAGIC_ERROR|MAGIC_MIME_TYPE/*|MAGIC_DEBUG*/;
if (conf->followLinks) {
magic_flags |= MAGIC_SYMLINK;
}
@ -296,7 +296,7 @@ KMimeMagicResult *KMimeMagic::findBufferType(const TQByteArray &array) {
conf->resultBuf = MIME_BINARY_ZEROSIZE;
}
else {
int magic_flags = MAGIC_CONTINUE|MAGIC_ERROR|MAGIC_MIME_TYPE/*|MAGIC_DEBUG*/;
int magic_flags = MAGIC_ERROR|MAGIC_MIME_TYPE/*|MAGIC_DEBUG*/;
if (conf->followLinks) {
magic_flags |= MAGIC_SYMLINK;
}

Loading…
Cancel
Save