mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Quick fix bug #4267.
A real fix would be to ditch the home made file format detection and use libmagic. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40587 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d2f2148c90
commit
3dba00246c
@ -813,6 +813,9 @@ string FileName::guessFormatFromContents() const
|
||||
// PKZIP
|
||||
static string const zipStamp = "PK";
|
||||
|
||||
// ZIP containers (koffice, openoffice.org etc).
|
||||
static string const nonzipStamp = "\008\0\0\0mimetypeapplication/";
|
||||
|
||||
// compress
|
||||
static string const compressStamp = "\037\235";
|
||||
|
||||
@ -840,7 +843,8 @@ string FileName::guessFormatFromContents() const
|
||||
if (prefixIs(str, gzipStamp)) {
|
||||
format = "gzip";
|
||||
|
||||
} else if (stamp == zipStamp) {
|
||||
} else if (stamp == zipStamp &&
|
||||
!contains(str, nonzipStamp)) {
|
||||
format = "zip";
|
||||
|
||||
} else if (stamp == compressStamp) {
|
||||
|
Loading…
Reference in New Issue
Block a user