correct magic for gzip and compress

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7412 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-07-28 12:47:20 +00:00
parent ebab2dbbfa
commit 618ad87140
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,11 @@
2003-07-28 Lars Gullik Bjønnes <larsbj@gullik.net>
* gzstream.h: new file
* filetools.C (getExtFromContents): correct magic for gzip and
compress.
* path_defines.[Ch]: move lyx_localedir out of anon namespace
* gzstream.h: new fileq
* gzstream.C: new file

View File

@ -955,9 +955,9 @@ string const GetExtension(string const & name)
// ...static char *...
// XWD \000\000\000\151 (0x00006900) decimal 105
//
// GZIP \037\213\010\010... http://www.ietf.org/rfc/rfc1952.txt
// GZIP \037\213 http://www.ietf.org/rfc/rfc1952.txt
// ZIP PK... http://www.halyava.ru/document/ind_arch.htm
// Z \037\177 UNIX compress
// Z \037\235 UNIX compress
/// return the "extension" which belongs to the contents.
/// for no knowing contents return the extension. Without
@ -975,13 +975,13 @@ string const getExtFromContents(string const & filename)
return string();
// gnuzip
string const gzipStamp = "\037\213\010\010";
string const gzipStamp = "\037\213";
// PKZIP
string const zipStamp = "PK";
// compress
string const compressStamp = "\037\177";
string const compressStamp = "\037\235";
// Maximum strings to read
int const max_count = 50;